projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch '18947-githttpd'
[arvados.git]
/
tools
/
vocabulary-migrate
/
vocabulary-migrate.py
diff --git
a/tools/vocabulary-migrate/vocabulary-migrate.py
b/tools/vocabulary-migrate/vocabulary-migrate.py
index c2b9da63b7ccf47729a1818423f6ffdf6b53aa22..89a4f030e862521251052328f9e3a4539fb62584 100644
(file)
--- a/
tools/vocabulary-migrate/vocabulary-migrate.py
+++ b/
tools/vocabulary-migrate/vocabulary-migrate.py
@@
-1,4
+1,4
@@
-#!/usr/bin/env python
+#!/usr/bin/env python
3
#
# Copyright (C) The Arvados Authors. All rights reserved.
#
#
# Copyright (C) The Arvados Authors. All rights reserved.
#
@@
-21,8
+21,8
@@
class VocabularyError(Exception):
pass
opts = argparse.ArgumentParser(add_help=False)
pass
opts = argparse.ArgumentParser(add_help=False)
-opts.add_argument('--vocabulary-file', type=str, metavar='PATH',
default=Non
e,
-
required=True,
help="""
+opts.add_argument('--vocabulary-file', type=str, metavar='PATH',
required=Tru
e,
+ help="""
Use vocabulary definition file at PATH for migration decisions.
""")
opts.add_argument('--dry-run', action='store_true', default=False,
Use vocabulary definition file at PATH for migration decisions.
""")
opts.add_argument('--dry-run', action='store_true', default=False,
@@
-111,8
+111,10
@@
def main(arguments=None):
if not args.dry_run and migrated_counter % 100 == 0:
logger.info('Migrating {} objects...'.format(migrated_counter))
if not args.dry_run and migrated_counter % 100 == 0:
logger.info('Migrating {} objects...'.format(migrated_counter))
- if not args.dry_run:
- logger.info('Done, total object migrated: {}.'.format(migrated_counter))
+ if args.dry_run and migrated_counter == 0:
+ logger.info('Nothing to do.')
+ elif not args.dry_run:
+ logger.info('Done, total objects migrated: {}.'.format(migrated_counter))
return 0
if __name__ == "__main__":
return 0
if __name__ == "__main__":