]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
schedule.py: make main() argv as an argument 553/head
authorLoic Dachary <ldachary@redhat.com>
Mon, 29 Jun 2015 13:19:26 +0000 (15:19 +0200)
committerLoic Dachary <ldachary@redhat.com>
Mon, 29 Jun 2015 21:55:08 +0000 (23:55 +0200)
Instead of using sys.argv implicitly, which is inconvenient for testing.

Signed-off-by: Loic Dachary <loic@dachary.org>
scripts/schedule.py

index 0c0348c11d4b4e2eecd2e23722406df2666741b2..c6c73dde7a014b1f04d436067006220316284814 100644 (file)
@@ -2,6 +2,7 @@ import docopt
 
 import teuthology.misc
 import teuthology.schedule
+import sys
 
 doc = """
 usage: teuthology-schedule -h
@@ -39,6 +40,6 @@ optional arguments:
 """
 
 
-def main():
-    args = docopt.docopt(doc)
+def main(argv=sys.argv[1:]):
+    args = docopt.docopt(doc, argv=argv)
     teuthology.schedule.main(args)