Handle "name" in openstack.name 69/66169/2
authorAric Gardner <agardner@linuxfoundation.org>
Wed, 25 Nov 2020 21:48:09 +0000 (16:48 -0500)
committerAric Gardner <agardner@linuxfoundation.org>
Thu, 26 Nov 2020 21:54:12 +0000 (16:54 -0500)
I thought this was 'cattle' everywhere.

Issue-Id: RELENG-2951
Signed-off-by: Aric Gardner <agardner@linuxfoundation.org>
Change-Id: I859aa4a53b73486f9c03869f05e3f45d7f951ec3

jenkins-admin/create_jenkins_clouds_openstack_yaml.py

index ae51bd8..ea92aa7 100755 (executable)
@@ -58,7 +58,7 @@ jenkins:
         credentialsId: {{ cloud_credential_id }}
         endPointUrl: {{ cloud_url }}
         ignoreSsl: {{ cloud_ignore_ssl }}
-        name: "cattle"
+        name: {{ cloud_name }}
         slaveOptions:
           availabilityZone: {{ availability_zone }}
           bootSource:
@@ -117,6 +117,8 @@ def parse_arguments():
 
     parser.add_argument('--path', type=dir_path,
                         help="Path to jenkins-admin directory")
+    parser.add_argument('--name', type=str,
+                        help="cloud name IE: cattle")
 
     parser.add_argument(
         "-s", "--sandbox",
@@ -178,7 +180,9 @@ for filename in glob.iglob(path, recursive=True):
 # Global cloud config section
 for section in config_parser_merged.sections():
     if section == "cloud":
-        final = (config.items(section))
+        afinal = (config.items(section))
+        name = parsed_args.name
+        final = (*afinal, ("cloud_name", name))
 
 
 for index, _ in enumerate(final):