Allow :s and :t as valid shortcuts when specifying roles for a database
authorGreg Sabino Mullane <greg@endpoint.com>
Fri, 13 Jun 2014 11:03:48 +0000 (07:03 -0400)
committerGreg Sabino Mullane <greg@endpoint.com>
Fri, 13 Jun 2014 11:03:48 +0000 (07:03 -0400)
bucardo

diff --git a/bucardo b/bucardo
index 7cc376aaaa1a38b243ad9224d5d733b2a127a51c..39912feeb6f5245958dae283bbaf4715183d575c 100755 (executable)
--- a/bucardo
+++ b/bucardo
@@ -8754,13 +8754,13 @@ sub extract_name_and_role {
     }
 
     ## Valid role name?
-    if ($role !~ /^(?:master|target|slave|rep|replica|source|fullcopy)$/) {
+    if ($role !~ /^(?:master|target|t|slave|rep|replica|source|s|fullcopy)$/) {
         die "Invalid database role: $role\n";
     }
 
     ## Standardize the names
-    $role = 'source' if $role =~ /master/;
-    $role = 'target' if $role =~ /slave|rep|tar/;
+    $role = 'source' if $role =~ /^(?:master|s)$/;
+    $role = 'target' if $role =~ /^(?:slave|rep|replica|tar|t)$/;
 
     return $name, $role, \%extra;