use Popen.wait instead of a sleep
authorPaul Tonelli <paul.tonelli@logilab.fr>
Tue, 16 Jul 2013 18:33:32 +0200
changeset 169 1b1a148fed55
parent 168 5a6f7425f820
child 170 98db7459001a
use Popen.wait instead of a sleep
others/ec2_ami_parser.py
--- a/others/ec2_ami_parser.py	Thu Jan 09 12:36:13 2014 +0100
+++ b/others/ec2_ami_parser.py	Tue Jul 16 18:33:32 2013 +0200
@@ -22,8 +22,7 @@
         pair=(pair[0],pair[1][0])
     if pair[1] != '':
         Popen(['salt-call', 'state.single', 'grains.present',
-            'name=' + pair[0], 'value=' + pair[1]])
-        sleep(1)
+            'name=' + pair[0], 'value=' + pair[1]]).wait()
 
 class FakeSecHead(object):
    def __init__(self, fp):