]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1541918 - Allow report ping namespace to be changed
authorDylan William Hardison <dylan@hardison.net>
Thu, 4 Apr 2019 16:14:58 +0000 (12:14 -0400)
committerGitHub <noreply@github.com>
Thu, 4 Apr 2019 16:14:58 +0000 (12:14 -0400)
Bugzilla/App/Command/report_ping.pm
Bugzilla/Report/Ping.pm

index 0958b5fe503ede2a171a8d9434f52e4a9a7e4fc1..b4382239f61787aeb3954d547669c9a131c66d32 100644 (file)
@@ -23,17 +23,17 @@ sub run {
   my $json
     = JSON::MaybeXS->new(convert_blessed => 1, canonical => 1, pretty => 1);
   my $report_type = 'Simple';
-  my ($page, $rows, $base_url, $test, $dump_schema);
-
+  my ($namespace, $page, $rows, $base_url, $test, $dump_schema);
 
   Bugzilla->usage_mode(USAGE_MODE_CMDLINE);
   getopt \@args,
-    'base-url|u=s'  => \$base_url,
-    'page|p=i'      => \$page,
-    'rows|r=i'      => \$rows,
-    'dump-schema'   => \$dump_schema,
-    'report-type=s' => \$report_type,
-    'test'          => \$test;
+    'base-url|u=s'   => \$base_url,
+    'page|p=i'       => \$page,
+    'rows|r=i'       => \$rows,
+    'dump-schema'    => \$dump_schema,
+    'report-type=s'  => \$report_type,
+    'namespace|ns=s' => \$namespace,
+    'test'           => \$test;
 
   $base_url = 'http://localhost' if $dump_schema || $test;
   die $self->usage unless $base_url;
@@ -41,10 +41,11 @@ sub run {
   my $report_class = "Bugzilla::Report::Ping::$report_type";
   require_module($report_class);
   my $report = $report_class->new(
-    model      => Bugzilla->dbh->model,
-    base_url   => $base_url,
-    maybe rows => $rows,
-    maybe page => $page,
+    model           => Bugzilla->dbh->model,
+    base_url        => $base_url,
+    maybe rows      => $rows,
+    maybe page      => $page,
+    maybe namespace => $namespace,
   );
 
   if ($dump_schema) {
index c2a32479b1f46415edeb134dc78105da93d3721d..7cecb961d7c075779d50bc924250439bff63a9e5 100644 (file)
@@ -68,7 +68,7 @@ around '_build_resultset' => sub {
   return $rs;
 };
 
-has 'namespace' => (is => 'lazy', init_arg => undef, isa => Str);
+has 'namespace' => (is => 'lazy', isa => Str);
 
 sub _build_namespace {
   return 'bugzilla';