File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -81,17 +81,22 @@ def main():
81
81
82
82
if '*' in tpath :
83
83
raise parser .error ('invalid target path: must be single db or empty' )
84
- elif '*' in spath and tpath :
85
- raise parser .error ('target path must be empty with multiple sources' )
86
84
87
85
all = sorted (i for i in source if i [0 ] != '_' ) # Skip reserved names.
88
86
if not spath :
89
87
raise parser .error ('source database must be specified' )
90
88
91
- databases = [( i , i ) for i in all if fnmatch .fnmatchcase (i , spath )]
92
- if not databases :
89
+ sources = [i for i in all if fnmatch .fnmatchcase (i , spath )]
90
+ if not sources :
93
91
raise parser .error ("no source databases match glob '%s'" % spath )
94
92
93
+ if len (sources ) > 1 and tpath :
94
+ raise parser .error ('target path must be empty with multiple sources' )
95
+ elif len (sources ) == 1 :
96
+ databases = [(sources [0 ], tpath )]
97
+ else :
98
+ databases = [(i , i ) for i in sources ]
99
+
95
100
# do the actual replication
96
101
97
102
for sdb , tdb in databases :
You can’t perform that action at this time.
0 commit comments