Fix some indentation and pep errors

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
This commit is contained in:
Angus Salkeld 2012-05-03 22:01:09 +10:00
parent 07148b41e7
commit c0b9519e49
7 changed files with 14 additions and 15 deletions

View 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 = {}

View File

@ -122,5 +122,3 @@ class ElasticIpAssociation(Resource):
server.remove_floating_ip(self.t['Properties']['EIP'])
self.state_set(self.DELETE_COMPLETE)

View File

@ -46,7 +46,6 @@ else:
break
class Instance(Resource):
def __init__(self, name, json_snippet, stack):

View File

@ -94,5 +94,3 @@ class SecurityGroup(Resource):
def FnGetRefId(self):
return unicode(self.name)

View File

@ -125,4 +125,3 @@ class VolumeAttachment(Resource):
vol.get()
self.state_set(self.DELETE_COMPLETE)

View 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()

View 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')