Skip to contentSkip to conversation

issues running teuthology-openstack on private cloud

PATCH Snyder, Emile 1 participant 1 message Dec 1, 2015

lore
Share & tools
lore
#0 lore raw

Hi,

I’m trying to get set up to use teuthology to run tests on an in-house openstack cloud. Is this list the appropriate venue?

I had to make 2 changes to get teuthology-openstack to run on my dev machine; first there is a hardcoded set of providers in OpenStack.set_provider to match the AUTH_URL in your environment, and second the shape of the result data that I see in the OpenStack.get_value(result, field) method doesn’t match the code expectations. The code expects to see

[{“Field”: “name”, “Value”: “foo”}{“Field”: “image”, “Value”: “…"}] but I see {“name”: “foo” “image”: “…"}; any ideas why?

When I hack around those 2 things (attached diff) I can “successfully” run

'teuthology-openstack —key-filename myself.pem —key-name myself —suite dummy’

and the vm’s are created, I see the job in Pulpito, but the log from within Pulpito shows it’s hitting the get_value issue on the VM as well.

I’m having a hard time seeing how to get the VM’s to use my patched version of teuthology too.

Thanks,
-Emile

teuthology/openstack/__init__.py +9 -3
index 36ab682..06ab2cc 100644
@@ -76,7 +76,8 @@ class OpenStack(object):
         providers = (('cloud.ovh.net', 'ovh'),
                      ('entercloudsuite.com', 'entercloudsuite'),
                      ('rackspacecloud.com', 'rackspace'),
-                     ('dream.io', 'dreamhost'))
+                     ('dream.io', 'dreamhost'),
+                     ('ebayc3.com', 'ebayc3'))
         self.provider = None
         for (pattern, provider) in providers:
             if pattern in os.environ['OS_AUTH_URL']:
@@ -95,8 +96,13 @@ class OpenStack(object):
         :param field:   The name of the field whose value to retrieve. Case is
                         ignored.
         """
-        filter_func = lambda v: v['Field'].lower() == field.lower()
-        return filter(filter_func, result)[0]['Value']
+        if type(result) == type([]):
+            filter_func = lambda v: v['Field'].lower() == field.lower()
+            return filter(filter_func, result)[0]['Value']
+        else:
+            # we don't see lists of dicts with Field/Value entries, but just a single dict
+            lcase_result_dict = {k.lower():v for k,v in result.items() if k.lower() == field.lower()}
+            return lcase_result_dict.get(field.lower())
 
     def image_exists(self, image):
         """