work on openstack client:
authorPaul Tonelli <paul.tonelli@logilab.fr>
Thu, 21 Mar 2013 14:33:54 +0100
changeset 2 23272de16625
parent 1 8b17affcf529
child 3 6cca0ba6876f
work on openstack client: - improved auth system for nova and glance - correct style
_modules/openstack_client.py
--- a/_modules/openstack_client.py	Thu Mar 21 14:33:03 2013 +0100
+++ b/_modules/openstack_client.py	Thu Mar 21 14:33:54 2013 +0100
@@ -11,20 +11,24 @@
     really ugly, but works
     until credentials expire
     '''
-    environ['OS_AUTH_URL']='http://control.example.com:5000/v2.0'
-    environ['OS_TENANT_ID']='00000000000000000000000000000000'
-    environ['OS_TENANT_NAME']='tenant'
-    environ['OS_USERNAME']='username'
-    environ['OS_PASSWORD']='password'
+    environ['OS_AUTH_URL'] = 'http://control.example.com:5000/v2.0'
+    environ['OS_TENANT_ID'] = '00000000000000000000000000000000'
+    environ['OS_TENANT_NAME'] = 'tenant'
+    environ['OS_USERNAME'] = 'username'
+    environ['OS_PASSWORD'] = 'password'
 
 def get_running_instances():
+    data = __salt__['nova.list']()
+    print data
     set_vars()
-    return glance_client.get_client(host='0.0.0.0')
+    gc = glance_client.get_client(host='0.0.0.0')
+    print gc.get_images()
+    return True
 
 def test_pillars():
     pillars_val = __salt__['pillar.raw']()['master']
     print pillars_val
     for i in pillars_val:
-        if i.find("keystone")!=-1:
+        if i.find("keystone") != -1:
             print i + " : " + pillars_val[i]
     return True