* Fixed --vocabulary-file argument requirement check
* Modified API server querying to get stable listings
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima@veritasgenetics.com>
Please take into account that this script requires admin credentials. It also offers a @--dry-run@ flag that will report what changes are required without applying them, so it can be reviewed by an administrator.
Please take into account that this script requires admin credentials. It also offers a @--dry-run@ flag that will report what changes are required without applying them, so it can be reviewed by an administrator.
+Also, take into consideration that this example script does case-sensitive matching on labels.
+
{% codeblock as python %}
{% include 'vocabulary_migrate_py' %}
{% endcodeblock %}
\ No newline at end of file
{% codeblock as python %}
{% include 'vocabulary_migrate_py' %}
{% endcodeblock %}
\ No newline at end of file
-{% comment %}
-Copyright (C) The Arvados Authors. All rights reserved.
-
-SPDX-License-Identifier: CC-BY-SA-3.0
-{% endcomment %}
+#
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: CC-BY-SA-3.0
import argparse
import copy
import argparse
import copy
opts = argparse.ArgumentParser(add_help=False)
opts.add_argument('--vocabulary-file', type=str, metavar='PATH', default=None,
opts = argparse.ArgumentParser(add_help=False)
opts.add_argument('--vocabulary-file', type=str, metavar='PATH', default=None,
+ required=True, 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,
args = arg_parser.parse_args(arguments)
if args.debug:
logger.setLevel(logging.DEBUG)
args = arg_parser.parse_args(arguments)
if args.debug:
logger.setLevel(logging.DEBUG)
- if args.vocabulary_file is None:
- arg_parser.error('Please specify the vocabulary file with --vocabulary-file')
- elif not os.path.isfile(args.vocabulary_file):
+ if not os.path.isfile(args.vocabulary_file):
arg_parser.error("{} doesn't exist or isn't a file.".format(args.vocabulary_file))
return args
arg_parser.error("{} doesn't exist or isn't a file.".format(args.vocabulary_file))
return args
for resource in [arv.collections(), arv.groups()]:
objs = arvados.util.list_all(
resource.list,
for resource in [arv.collections(), arv.groups()]:
objs = arvados.util.list_all(
resource.list,
select=['uuid', 'properties'],
filters=[['properties', 'exists', key_label]]
)
select=['uuid', 'properties'],
filters=[['properties', 'exists', key_label]]
)