Code Review
/
yardstick.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
base: remove redudant ip_to_convert
[yardstick.git]
/
yardstick
/
orchestrator
/
heat.py
diff --git
a/yardstick/orchestrator/heat.py
b/yardstick/orchestrator/heat.py
index
a99d463
..
2a907d1
100644
(file)
--- a/
yardstick/orchestrator/heat.py
+++ b/
yardstick/orchestrator/heat.py
@@
-1,4
+1,4
@@
-#############################################################################
#
+#############################################################################
# Copyright (c) 2015-2017 Ericsson AB and others.
#
# All rights reserved. This program and the accompanying materials
# Copyright (c) 2015-2017 Ericsson AB and others.
#
# All rights reserved. This program and the accompanying materials
@@
-230,7
+230,8
@@
name (i.e. %s).\
'value': {'get_resource': name}
}
'value': {'get_resource': name}
}
- def add_network(self, name, physical_network='physnet1', provider=None):
+ def add_network(self, name, physical_network='physnet1', provider=None,
+ segmentation_id=None):
"""add to the template a Neutron Net"""
log.debug("adding Neutron::Net '%s'", name)
if provider is None:
"""add to the template a Neutron Net"""
log.debug("adding Neutron::Net '%s'", name)
if provider is None:
@@
-247,6
+248,9
@@
name (i.e. %s).\
'physical_network': physical_network
}
}
'physical_network': physical_network
}
}
+ if segmentation_id:
+ seg_id_dit = {'segmentation_id': segmentation_id}
+ self.resources[name]["properties"].update(seg_id_dit)
def add_server_group(self, name, policies): # pragma: no cover
"""add to the template a ServerGroup"""
def add_server_group(self, name, policies): # pragma: no cover
"""add to the template a ServerGroup"""
@@
-530,6
+534,7
@@
name (i.e. %s).\
}
HEAT_WAIT_LOOP_INTERVAL = 2
}
HEAT_WAIT_LOOP_INTERVAL = 2
+ HEAT_CREATE_COMPLETE_STATUS = u'CREATE_COMPLETE'
def create(self, block=True, timeout=3600):
"""
def create(self, block=True, timeout=3600):
"""
@@
-554,14
+559,18
@@
name (i.e. %s).\
if not block:
self.outputs = stack.outputs = {}
if not block:
self.outputs = stack.outputs = {}
+ end_time = time.time()
+ log.info("Created stack '%s' in %.3e secs",
+ self.name, end_time - start_time)
return stack
time_limit = start_time + timeout
return stack
time_limit = start_time + timeout
- for status in iter(self.status,
u'CREATE_COMPLETE'
):
+ for status in iter(self.status,
self.HEAT_CREATE_COMPLETE_STATUS
):
log.debug("stack state %s", status)
if status == u'CREATE_FAILED':
log.debug("stack state %s", status)
if status == u'CREATE_FAILED':
- raise RuntimeError(
- heat_client.stacks.get(self.uuid).stack_status_reason)
+ stack_status_reason = heat_client.stacks.get(self.uuid).stack_status_reason
+ heat_client.stacks.delete(self.uuid)
+ raise RuntimeError(stack_status_reason)
if time.time() > time_limit:
raise RuntimeError("Heat stack create timeout")
if time.time() > time_limit:
raise RuntimeError("Heat stack create timeout")
@@
-569,7
+578,7
@@
name (i.e. %s).\
end_time = time.time()
outputs = heat_client.stacks.get(self.uuid).outputs
end_time = time.time()
outputs = heat_client.stacks.get(self.uuid).outputs
- log.info("Created stack '%s' in %
d
secs",
+ log.info("Created stack '%s' in %
.3e
secs",
self.name, end_time - start_time)
# keep outputs as unicode
self.name, end_time - start_time)
# keep outputs as unicode