summaryrefslogtreecommitdiff
path: root/heat/scaling
diff options
context:
space:
mode:
authorZane Bitter <zbitter@redhat.com>2015-08-15 18:40:24 -0400
committerSteve Baker <sbaker@redhat.com>2015-09-08 08:44:18 +1200
commit3109d90ce52167893667c1915d167b1421290589 (patch)
tree9edea518123673245ee90f650ecaa5104285f2da /heat/scaling
parenta5b2f399f7348dc5a7c9ff2d14fedab4d75c3308 (diff)
downloadheat-3109d90ce52167893667c1915d167b1421290589.tar.gz
Allow a custom new ID function for member_definitions()
Previously we always used a random short_id, and that is indeed what we want for Autoscaling groups, but ResourceGroups generally use sequential IDs, so pass a function that generates them instead of hard-coding it. By happy accident, this makes the tests a bit nicer too. Change-Id: I58ce67e4b58378f35d5690d653a113b03ee6e08e Partially-Implements: blueprint scaling-group-common
Diffstat (limited to 'heat/scaling')
-rw-r--r--heat/scaling/template.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/heat/scaling/template.py b/heat/scaling/template.py
index 0b1aab0dd..efdd8304b 100644
--- a/heat/scaling/template.py
+++ b/heat/scaling/template.py
@@ -11,12 +11,12 @@
# License for the specific language governing permissions and limitations
# under the License.
-from heat.common import short_id
from heat.engine import template
def member_definitions(old_resources, new_definition,
- num_resources, num_new):
+ num_resources, num_new,
+ get_new_id):
"""
Iterate over resource definitions for a scaling group
@@ -48,7 +48,7 @@ def member_definitions(old_resources, new_definition,
else:
yield old_name, old_definition
else:
- yield short_id.generate_id(), new_definition
+ yield get_new_id(), new_definition
def make_template(resource_definitions,