]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Add teuthology-update-inventory command 461/head
authorZack Cerza <zack@redhat.com>
Tue, 7 Apr 2015 16:54:28 +0000 (10:54 -0600)
committerZack Cerza <zack@redhat.com>
Tue, 7 Apr 2015 22:39:58 +0000 (16:39 -0600)
This ought to also replace teuthology-updatekeys, but might not be as
fast yet.

Signed-off-by: Zack Cerza <zack@redhat.com>
scripts/update_inventory.py [new file with mode: 0644]
setup.py

diff --git a/scripts/update_inventory.py b/scripts/update_inventory.py
new file mode 100644 (file)
index 0000000..e281231
--- /dev/null
@@ -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)
+
index f653b597c6e36d74811b69bad115b9b5f5f92e95..d3b44319c4c73d113b53420fef20fafa36fa1c2d 100644 (file)
--- 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',