From: Zack Cerza Date: Fri, 25 Mar 2022 20:25:02 +0000 (-0600) Subject: teuthology-update-inventory: Add machine type flag X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=cd8e49df105e375e0ffdb497efa1b27498187673;p=teuthology.git teuthology-update-inventory: Add machine type flag With this change, the tool can be trivially used to add new nodes to paddles. Signed-off-by: Zack Cerza --- diff --git a/scripts/update_inventory.py b/scripts/update_inventory.py index 73da8aa67f..014e3ccf5c 100644 --- a/scripts/update_inventory.py +++ b/scripts/update_inventory.py @@ -10,14 +10,16 @@ import logging doc = """ usage: teuthology-update-inventory -h - teuthology-update-inventory [-v] REMOTE [REMOTE ...] + teuthology-update-inventory [-v] [-m type] REMOTE [REMOTE ...] Update the given nodes' inventory information on the lock server - -h, --help show this help message and exit - -v, --verbose be more verbose - REMOTE hostnames of machines whose information to update + -h, --help show this help message and exit + -v, --verbose be more verbose + -m , --machine-type optionally specify a machine type when + submitting nodes for the first time + REMOTE hostnames of machines whose information to update """ @@ -27,10 +29,13 @@ def main(): if args['--verbose']: teuthology.log.setLevel(logging.DEBUG) + machine_type = args.get('--machine-type') remotes = args.get('REMOTE') for rem_name in remotes: rem_name = teuthology.misc.canonicalize_hostname(rem_name) remote = teuthology.orchestra.remote.Remote(rem_name) remote.connect() inventory_info = remote.inventory_info + if machine_type: + inventory_info['machine_type'] = machine_type teuthology.lock.ops.update_inventory(inventory_info)