tar, tar+gzip,tar+bz2 and zip
'''
_sources = {}
+
def __init__(self, sources):
self._sources = sources
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()
logging.exception(e)
self._decompress(tmp_name, dest)
+
class ServicesHandler(object):
_services = {}
server.remove_floating_ip(self.t['Properties']['EIP'])
self.state_set(self.DELETE_COMPLETE)
-
-
break
-
class Instance(Resource):
def __init__(self, name, json_snippet, stack):
def FnGetRefId(self):
return unicode(self.name)
-
-
vol.get()
self.state_set(self.DELETE_COMPLETE)
-
logger = logging.getLogger(__file__)
+
class WaitConditionHandle(Resource):
'''
the main point of this class is to :
'''
return unicode(self.instance_id)
+
class WaitCondition(Resource):
def __init__(self, name, json_snippet, stack):
self.handle_url = self.t['Properties']['Handle']
self.timeout = self.t['Properties']['Timeout']
-
def create(self):
if self.state != None:
return
# 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()
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')