From 457c458f9d79dbbb6c617b475b18dbe9e1e86bc7 Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Tue, 7 Apr 2015 10:54:28 -0600 Subject: [PATCH] Add teuthology-update-inventory command This ought to also replace teuthology-updatekeys, but might not be as fast yet. Signed-off-by: Zack Cerza --- scripts/update_inventory.py | 33 +++++++++++++++++++++++++++++++++ setup.py | 1 + 2 files changed, 34 insertions(+) create mode 100644 scripts/update_inventory.py diff --git a/scripts/update_inventory.py b/scripts/update_inventory.py new file mode 100644 index 0000000000..e281231d6a --- /dev/null +++ b/scripts/update_inventory.py @@ -0,0 +1,33 @@ +import docopt + +import teuthology +import teuthology.lock +import teuthology.orchestra.remote + +import logging + +doc = """ +usage: teuthology-update-inventory -h + teuthology-update-inventory [-v] 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 + +""" + + +def main(): + args = docopt.docopt(doc) + if args['--verbose']: + teuthology.log.setLevel(logging.DEBUG) + + remotes = args.get('REMOTE') + for rem_name in remotes: + remote = teuthology.orchestra.remote.Remote(rem_name) + inventory_info = remote.inventory_info + teuthology.lock.update_inventory(inventory_info) + diff --git a/setup.py b/setup.py index f653b597c6..d3b44319c4 100644 --- a/setup.py +++ b/setup.py @@ -55,6 +55,7 @@ setup( 'teuthology-lock = scripts.lock:main', 'teuthology-schedule = scripts.schedule:main', 'teuthology-updatekeys = scripts.updatekeys:main', + 'teuthology-update-inventory = scripts.update_inventory:main', 'teuthology-coverage = scripts.coverage:main', 'teuthology-results = scripts.results:main', 'teuthology-report = scripts.report:main', -- 2.39.5