Skip to content

Commit 41db1cd

Browse files
committed
Ensure mirror.py does nothing when invoked without arguments (#7146, PR #7162)
2 parents bac4526 + 996836f commit 41db1cd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

scripts/mirror.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,17 @@ def main(args):
7171
help='Limit mirroring to a subset of the configured sources. '
7272
'Supports shell-style wildcards to match multiple sources per argument. '
7373
'All sources must be public.')
74+
parser.add_argument('--mirror',
75+
action='store_true',
76+
help='Mirror files in the specified catalog and sources')
7477
parser.add_argument('--no-wait',
7578
action='store_false',
7679
dest='wait',
7780
help='Do not wait for queues to empty before exiting script.')
7881
args = parser.parse_args(args)
7982
assert config.enable_mirroring, R('Mirroring is not enabled')
80-
mirror_catalog(args.catalog, set(args.sources), args.wait)
83+
if args.mirror:
84+
mirror_catalog(args.catalog, set(args.sources), args.wait)
8185

8286

8387
if __name__ == '__main__':

0 commit comments

Comments
 (0)