]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
teuthology-openstack: update help for --test-repo argument
authorKyr Shatskyy <kyrylo.shatskyy@gmail.com>
Fri, 1 Mar 2019 18:38:33 +0000 (19:38 +0100)
committerKyr Shatskyy <kyrylo.shatskyy@gmail.com>
Wed, 13 Mar 2019 15:16:40 +0000 (16:16 +0100)
Signed-off-by: Kyr Shatskyy <kyrylo.shatskyy@gmail.com>
scripts/openstack.py

index 31de2b8469e9f31e85cafa6db1a3a2332aa52ae1..6d0d3592b707467a952a29e3699bf15b2c51d90b 100644 (file)
@@ -235,12 +235,8 @@ def get_openstack_parser():
     parser.add_argument(
         '--test-repo',
         action='append',
-        help=('Package repository, or repositories, to be added on test nodes. '
-              'Repository to be specified as a NAME:URL pair. Multiple '
-              'repositories can be provided with multiple usage. '
-              'For example --test-repo foo:http://example.com/repo/foo '
-              '--test-repo bar:http://example.com/repo/bar specifies two '
-              'test package repositories named "foo" and "bar", respectively.'),
+        help=('Package repository to be added on test nodes, which are specified '
+              'as NAME:URL, NAME!PRIORITY:URL or @FILENAME, for details see below.'),
         default=None,
     )
     return parser
@@ -255,6 +251,90 @@ def get_parser():
         ],
         conflict_handler='resolve',
         add_help=False,
+        epilog="""test repos:
+
+Test repository can be specified using --test-repo optional argument
+with value in the following formats:  NAME:URL, NAME!PRIORITY:URL
+or @FILENAME. See examples:
+
+1) Essential usage requires to provide repo name and url:
+
+    --test-repo foo:http://example.com/repo/foo
+
+2) Repo can be prioritized by adding a number after '!' symbol
+   in the name:
+
+    --test-repo 'bar!10:http://example.com/repo/bar'
+
+3) Repo data can be taken from a file by simply adding '@' symbol
+   at the beginning argument value, for example from yaml:
+
+    --test-repo @path/to/foo.yaml
+
+  where `foo.yaml` contains one or more records like:
+
+  - name: foo
+    priority: 1
+    url: http://example.com/repo/foo
+
+4) Or from json file:
+
+    --test-repo @path/to/foo.json
+
+   where `foo.json` content is:
+
+   [{"name":"foo","priority":1,"url":"http://example.com/repo/foo"}]
+
+
+Several repos can be provided with multiple usage of --test-repo and/or
+you can provide several repos within one yaml or json file.
+The repositories are added in the order they appear in the command line or
+in the file. Example:
+
+    ---
+    # The foo0 repo will be included first, after all that have any priority,
+    # in particular after foo1 because it has lowest priority
+    - name: foo0
+      url: http://example.com/repo/foo0
+    # The foo1 will go after foo2 because it has lower priority then foo2
+    - name: foo1
+      url: http://example.com/repo/foo1
+      priority: 2
+    # The foo2 will go first because it has highest priority
+    - name: foo2
+      url: http://example.com/repo/foo2
+      priority: 1
+    # The foo3 will go after foo0 because it appears after it in this file
+    - name: foo3
+      url: http://example.com/repo/foo3
+
+Equivalent json file content below:
+
+    [
+      {
+        "name": "foo0",
+        "url": "http://example.com/repo/foo0"
+      },
+      {
+        "name": "foo1",
+        "url": "http://example.com/repo/foo1",
+        "priority": 2
+      },
+      {
+        "name": "foo2",
+        "url": "http://example.com/repo/foo2",
+        "priority": 1
+      },
+      {
+        "name": "foo3",
+        "url": "http://example.com/repo/foo3"
+      }
+    ]
+
+At the moment supported only files with extensions: .yaml, .yml, .json, .jsn.
+
+teuthology-openstack %s
+""" % teuthology.__version__,
         description="""
 Run a suite of ceph integration tests. A suite is a directory containing
 facets. A facet is a directory containing config snippets. Running a suite