[Rt-commit] r9333 - rtir/branches/2.3-EXPERIMENTAL/etc

ruz at bestpractical.com ruz at bestpractical.com
Tue Oct 16 17:59:58 EDT 2007


Author: ruz
Date: Tue Oct 16 17:59:58 2007
New Revision: 9333

Modified:
   rtir/branches/2.3-EXPERIMENTAL/etc/add_constituency

Log:
* update addresses when queue exists

Modified: rtir/branches/2.3-EXPERIMENTAL/etc/add_constituency
==============================================================================
--- rtir/branches/2.3-EXPERIMENTAL/etc/add_constituency	(original)
+++ rtir/branches/2.3-EXPERIMENTAL/etc/add_constituency	Tue Oct 16 17:59:58 2007
@@ -316,8 +316,20 @@
         debug "\tcorrespond address:\t$opt{'correspond'}" if $opt{'correspond'};
     } else {
         debug "Queue '$name' already exists";
+        foreach my $type ( qw(Comment Correspond) ) {
+            next unless $opt{ lc $type };
+            my $method = $type .'Address';
+            my $current = $queue->$method();
+            next if $current eq $opt{ lc $type };
 
-        # TODO: update addresses
+            $method = 'Set'. $method;
+            my ($status, $msg) = $queue->$method( $opt{ lc $type } );
+            unless ( $status ) {
+                print STDERR "Couldn't set $type address of '$name' queue\n";
+            } else {
+                debug "\tnew $type address: ". $opt{ lc $type };
+            }
+        }
     }
 
     die "Failed to create queue $name." unless $queue->id;
@@ -325,4 +337,3 @@
     return $queue;
 }
 
-


More information about the Rt-commit mailing list