simplified ami_parser.py
authorPaul Tonelli <paul.tonelli@logilab.fr>
Thu, 21 Mar 2013 14:52:58 +0100
changeset 71 d13233afb293
parent 70 afe92adc13cc
child 72 a66ccae3aca2
simplified ami_parser.py
others/ec2_ami_parser.py
readme.txt
--- a/others/ec2_ami_parser.py	Tue Mar 12 17:41:25 2013 +0100
+++ b/others/ec2_ami_parser.py	Thu Mar 21 14:52:58 2013 +0100
@@ -18,18 +18,7 @@
     state.highstate() #does not work and requires __salt__ dict
     '''
     line = line.rsplit('#')[0].lstrip().rstrip()
-    if line.startswith('ami.hg_address:'):
-        #grains.present(name='custom_hg_address', value=line)
-        Popen(['salt-call', 'state.single', 'grains.present',
-            'name=ami.hg_address', 'value=' +
-            line.split(':',1)[-1].lstrip()])
-    elif line.startswith('ami.hg_rev:'):
-        Popen(['salt-call', 'state.single', 'grains.present',
-            'name=ami.hg_rev', 'value=' + line.split(':',1)[-1].lstrip()])
-    elif line.startswith('ami.type:'):
-        Popen(['salt-call', 'state.single', 'grains.present',
-            'name=ami.type', 'value=' + line.split(':',1)[-1].lstrip()])
-    elif ':' in line:
+    if ':' in line:
         Popen(['salt-call', 'state.single', 'grains.present',
             'name=' + line.split(':',1)[0].rstrip(), 'value=' + line.split(':',1)[-1].lstrip()])
     sleep(1)
--- a/readme.txt	Tue Mar 12 17:41:25 2013 +0100
+++ b/readme.txt	Thu Mar 21 14:52:58 2013 +0100
@@ -18,16 +18,16 @@
 
 ====== START =======
 
-ami.hg_rev: c3984088f6b5
+ami.hg_rev: cd5da6d9d4fe
 ami.hg_address: http://hg.logilab.fr/users/ptonelli/srv_salt
 ami.type: debian #or ubuntu
 
 ### optionnal ###
-keystone.user: ptonelli
-keystone.password: ptonelli
-keystone.tenant: ptonelli
-keystone.tenant_id: 7050e8e884414ef985826434c52d93f3
-keystone.auth_url: 'http://control.openstack.logilab.fr:5000/v2.0'
+keystone.user: usearname
+keystone.password: password
+keystone.tenant: tenant
+keystone.tenant_id: 00000000000000000000000000000000
+keystone.auth_url: 'http://control.example.com:5000/v2.0'
 keystone.insecure: False   #(optional)
 
 ### only if you know what you are doing ! ###