From: Dylan William Hardison Date: Thu, 4 Apr 2019 16:14:58 +0000 (-0400) Subject: Bug 1541918 - Allow report ping namespace to be changed X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5d74a11cfde8b90244f950a33b2b69405da04646;p=thirdparty%2Fbugzilla.git Bug 1541918 - Allow report ping namespace to be changed --- diff --git a/Bugzilla/App/Command/report_ping.pm b/Bugzilla/App/Command/report_ping.pm index 0958b5fe5..b4382239f 100644 --- a/Bugzilla/App/Command/report_ping.pm +++ b/Bugzilla/App/Command/report_ping.pm @@ -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) { diff --git a/Bugzilla/Report/Ping.pm b/Bugzilla/Report/Ping.pm index c2a32479b..7cecb961d 100644 --- a/Bugzilla/Report/Ping.pm +++ b/Bugzilla/Report/Ping.pm @@ -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';