]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Fix some indentation and pep errors
authorAngus Salkeld <asalkeld@redhat.com>
Thu, 3 May 2012 12:01:09 +0000 (22:01 +1000)
committerAngus Salkeld <asalkeld@redhat.com>
Thu, 3 May 2012 12:01:09 +0000 (22:01 +1000)
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
heat/cfntools/cfn_helper.py
heat/engine/eip.py
heat/engine/instance.py
heat/engine/security_group.py
heat/engine/volume.py
heat/engine/wait_condition.py
heat/tests/test_cfn.py

index 7415cee89a11894318598ee1b5ddb400808d6838..e56ed49ed91eb0421bd8a46500c94bd755295b9a 100644 (file)
@@ -556,6 +556,7 @@ class SourcesHandler(object):
     tar, tar+gzip,tar+bz2 and zip
     '''
     _sources = {}
+
     def __init__(self, sources):
         self._sources = sources
 
@@ -573,15 +574,15 @@ class SourcesHandler(object):
 
     def _decompress(self, archive, dest_dir):
         (r, ext) = os.path.splitext(archive)
-         if ext is 'tar.gz' or ext is 'tgz':
+        if ext is 'tar.gz' or ext is 'tgz':
             cmd_str = 'tar -C %s -xzf %s' % (dest_dir, archive)
-         elif ext is 'tar.bz2' or ext is 'tbz2':
+        elif ext is 'tar.bz2' or ext is 'tbz2':
             cmd_str = 'tar -C %s -xjf %s' % (dest_dir, archive)
-         elif ext is 'zip':
+        elif ext is 'zip':
             cmd_str = 'unzip -d %s %s' % (dest_dir, archive)
-         elif ext is 'tar':
+        elif ext is 'tar':
             cmd_str = 'tar -C %s -xf %s' % (dest_dir, archive)
-         else:
+        else:
             pass
         CommandRunner(cmd_str).run()
 
@@ -601,6 +602,7 @@ class SourcesHandler(object):
                     logging.exception(e)
             self._decompress(tmp_name, dest)
 
+
 class ServicesHandler(object):
     _services = {}
 
index f0b2b6243613e8c8e30ae64debd31aff6d5c0e33..a0d94cdcbc30ec07a19d94b6e460db28e3856f97 100644 (file)
@@ -122,5 +122,3 @@ class ElasticIpAssociation(Resource):
         server.remove_floating_ip(self.t['Properties']['EIP'])
 
         self.state_set(self.DELETE_COMPLETE)
-
-
index ad72b80d6df0e345650620c282dc94d22f5ec4b4..412b127dfbdfda5076bbbce79a01eff5d0d1dedf 100644 (file)
@@ -46,7 +46,6 @@ else:
             break
 
 
-
 class Instance(Resource):
 
     def __init__(self, name, json_snippet, stack):
index 7e2fec23c9a4439484cd38c3f623db3df7204a02..68b9cb3e28c597946fde139f343896e2ccfeab1d 100644 (file)
@@ -94,5 +94,3 @@ class SecurityGroup(Resource):
 
     def FnGetRefId(self):
         return unicode(self.name)
-
-
index eb5f0cacc03b9e69f0ed26bfc5cc7741b2acfe1c..d420b442f17bf75cf8f43b4e6f8c7cd3281bcc4a 100644 (file)
@@ -125,4 +125,3 @@ class VolumeAttachment(Resource):
             vol.get()
 
         self.state_set(self.DELETE_COMPLETE)
-
index 6b398fde880e2552ceaf9d94436457359cf75486..797d0d7eb196d8aeabde1b1795ec39d1e95d1137 100644 (file)
@@ -22,6 +22,7 @@ from heat.engine.resources import Resource
 
 logger = logging.getLogger(__file__)
 
+
 class WaitConditionHandle(Resource):
     '''
     the main point of this class is to :
@@ -72,6 +73,7 @@ class WaitConditionHandle(Resource):
         '''
         return unicode(self.instance_id)
 
+
 class WaitCondition(Resource):
 
     def __init__(self, name, json_snippet, stack):
@@ -81,7 +83,6 @@ class WaitCondition(Resource):
         self.handle_url = self.t['Properties']['Handle']
         self.timeout = self.t['Properties']['Timeout']
 
-
     def create(self):
         if self.state != None:
             return
@@ -99,7 +100,8 @@ class WaitCondition(Resource):
 #                raise # not my timeout
 #            else:
 #                self.state_set(self.CREATE_FAILED,
-#                               '%s Timed out waiting for instance to start' % self.name)
+#                               '%s Timed out waiting for instance' % \
+#                               self.name)
 #        finally:
 #            timeout.cancel()
 
index e59d5c95f0452886b5eb33234428beae07dc6d37..5a2f1e30c557ad582f9d15bb6620f63fa87b9a40 100644 (file)
@@ -14,9 +14,10 @@ import unittest
 import shutil
 from nose.exc import SkipTest
 try:
-  from heat.cfntools.cfn_helper import *
+    from heat.cfntools.cfn_helper import *
 except:
-  raise SkipTest("unable to import cfn helper, skipping")
+    raise SkipTest("unable to import cfn helper, skipping")
+
 
 @attr(tag=['unit', 'cfn_helper'])
 @attr(speed='fast')