if self.uuid is None:
return
- log.info("Deleting stack '%s', uuid:%s", self.name, self.uuid)
+ log.info("Deleting stack '%s' START, uuid:%s", self.name, self.uuid)
heat = self.heat_client
template = heat.stacks.get(self.uuid)
start_time = time.time()
template.delete()
for status in iter(self.status, u'DELETE_COMPLETE'):
- log.debug("stack state %s", status)
+ log.debug("Deleting stack state: %s", status)
if status == u'DELETE_FAILED':
raise RuntimeError(
heat.stacks.get(self.uuid).stack_status_reason)
time.sleep(2)
end_time = time.time()
- log.info("Deleted stack '%s' in %d secs", self.name,
+ log.info("Deleting stack '%s' DONE in %d secs", self.name,
end_time - start_time)
self.uuid = None
self.resources[name]['properties']['mountpoint'] = mountpoint
def add_network(self, name, physical_network='physnet1', provider=None,
- segmentation_id=None, port_security_enabled=None):
+ segmentation_id=None, port_security_enabled=None, network_type=None):
"""add to the template a Neutron Net"""
log.debug("adding Neutron::Net '%s'", name)
if provider is None:
'type': 'OS::Neutron::ProviderNet',
'properties': {
'name': name,
- 'network_type': 'vlan',
+ 'network_type': 'flat' if network_type is None else network_type,
'physical_network': physical_network,
},
}
if segmentation_id:
self.resources[name]['properties']['segmentation_id'] = segmentation_id
+ if network_type is None:
+ self.resources[name]['properties']['network_type'] = 'vlan'
# if port security is not defined then don't add to template:
# some deployments don't have port security plugin installed
if port_security_enabled is not None:
:param: timeout: timeout in seconds for Heat create, default 3600s
:type timeout: int
"""
- log.info("Creating stack '%s'", self.name)
+ log.info("Creating stack '%s' START", self.name)
# create stack early to support cleanup, e.g. ctrl-c while waiting
stack = HeatStack(self.name)
if not block:
self.outputs = stack.outputs = {}
end_time = time.time()
- log.info("Created stack '%s' in %.3e secs",
+ log.info("Creating stack '%s' DONE in %d secs",
self.name, end_time - start_time)
return stack
time_limit = start_time + timeout
for status in iter(self.status, self.HEAT_CREATE_COMPLETE_STATUS):
- log.debug("stack state %s", status)
+ log.debug("Creating stack state: %s", status)
if status == u'CREATE_FAILED':
stack_status_reason = heat_client.stacks.get(self.uuid).stack_status_reason
heat_client.stacks.delete(self.uuid)
end_time = time.time()
outputs = heat_client.stacks.get(self.uuid).outputs
- log.info("Created stack '%s' in %.3e secs",
+ log.info("Creating stack '%s' DONE in %d secs",
self.name, end_time - start_time)
# keep outputs as unicode