From c0b9519e49ad5dda2d92df2b22ff19a6afc365e2 Mon Sep 17 00:00:00 2001 From: Angus Salkeld Date: Thu, 3 May 2012 22:01:09 +1000 Subject: [PATCH] Fix some indentation and pep errors Signed-off-by: Angus Salkeld --- heat/cfntools/cfn_helper.py | 12 +++++++----- heat/engine/eip.py | 2 -- heat/engine/instance.py | 1 - heat/engine/security_group.py | 2 -- heat/engine/volume.py | 1 - heat/engine/wait_condition.py | 6 ++++-- heat/tests/test_cfn.py | 5 +++-- 7 files changed, 14 insertions(+), 15 deletions(-) diff --git a/heat/cfntools/cfn_helper.py b/heat/cfntools/cfn_helper.py index 7415cee8..e56ed49e 100644 --- a/heat/cfntools/cfn_helper.py +++ b/heat/cfntools/cfn_helper.py @@ -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 = {} diff --git a/heat/engine/eip.py b/heat/engine/eip.py index f0b2b624..a0d94cdc 100644 --- a/heat/engine/eip.py +++ b/heat/engine/eip.py @@ -122,5 +122,3 @@ class ElasticIpAssociation(Resource): server.remove_floating_ip(self.t['Properties']['EIP']) self.state_set(self.DELETE_COMPLETE) - - diff --git a/heat/engine/instance.py b/heat/engine/instance.py index ad72b80d..412b127d 100644 --- a/heat/engine/instance.py +++ b/heat/engine/instance.py @@ -46,7 +46,6 @@ else: break - class Instance(Resource): def __init__(self, name, json_snippet, stack): diff --git a/heat/engine/security_group.py b/heat/engine/security_group.py index 7e2fec23..68b9cb3e 100644 --- a/heat/engine/security_group.py +++ b/heat/engine/security_group.py @@ -94,5 +94,3 @@ class SecurityGroup(Resource): def FnGetRefId(self): return unicode(self.name) - - diff --git a/heat/engine/volume.py b/heat/engine/volume.py index eb5f0cac..d420b442 100644 --- a/heat/engine/volume.py +++ b/heat/engine/volume.py @@ -125,4 +125,3 @@ class VolumeAttachment(Resource): vol.get() self.state_set(self.DELETE_COMPLETE) - diff --git a/heat/engine/wait_condition.py b/heat/engine/wait_condition.py index 6b398fde..797d0d7e 100644 --- a/heat/engine/wait_condition.py +++ b/heat/engine/wait_condition.py @@ -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() diff --git a/heat/tests/test_cfn.py b/heat/tests/test_cfn.py index e59d5c95..5a2f1e30 100644 --- a/heat/tests/test_cfn.py +++ b/heat/tests/test_cfn.py @@ -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') -- 2.45.2