[Rt-commit] [rtir] 30/33: Bail out if unable to load the "base" queue in add_constituency
Shawn Moore
shawn at bestpractical.com
Fri May 13 20:21:48 EDT 2016
This is an automated email from the git hooks/post-receive script.
shawn pushed a commit to branch 3.4/countermeasures
in repository rtir.
commit ed5adc9a97b1ef2fd9b2688a972ba964bb2c3998
Author: Shawn M Moore <shawn at bestpractical.com>
Date: Fri May 13 23:48:17 2016 +0000
Bail out if unable to load the "base" queue in add_constituency
Also adds a fallback for trying to load the queue named Blocks
if the queue named Countermeasures is unavailable
---
bin/add_constituency.in | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/bin/add_constituency.in b/bin/add_constituency.in
index 7204f1d..81ca00b 100755
--- a/bin/add_constituency.in
+++ b/bin/add_constituency.in
@@ -473,7 +473,14 @@ sub create_or_load_queue {
my $basequeue = RT::Queue->new( RT->SystemUser );
- $basequeue->LoadByCols( Name => RT::IR::FriendlyLifecycle($lifecycle) );
+ my $basequeue_name = RT::IR::FriendlyLifecycle($lifecycle);
+ my ($ok, $msg) = $basequeue->LoadByCols( Name => $basequeue_name );
+
+ # support old name for Countermeasures
+ ($ok, $msg) = $basequeue->LoadByCols( Name => 'Blocks' )
+ if !$ok && $basequeue_name eq 'Countermeasures';
+
+ die "Unable to load queue named '$basequeue_name': $msg" if !$ok;
my $queue = RT::Queue->new($RT::SystemUser);
$queue->LoadByCols( Name => $name );
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the rt-commit
mailing list