Repository: incubator-ariatosca Updated Branches: refs/heads/ARIA-165-Make-node-name-suffix-UUIDs-become-more-readable 51480d500 -> 6c25143c1 (forced update)
ARIA-165 Make node name suffix UUIDs become more readable Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/6c25143c Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/6c25143c Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/6c25143c Branch: refs/heads/ARIA-165-Make-node-name-suffix-UUIDs-become-more-readable Commit: 6c25143c1f0420935892a3d5a5afd3dc28088d07 Parents: 0ec2370 Author: max-orlov <[email protected]> Authored: Mon May 8 15:25:37 2017 +0300 Committer: max-orlov <[email protected]> Committed: Mon May 8 17:39:56 2017 +0300 ---------------------------------------------------------------------- aria/modeling/service_template.py | 3 +-- aria/parser/modeling/context.py | 5 ----- 2 files changed, 1 insertion(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/6c25143c/aria/modeling/service_template.py ---------------------------------------------------------------------- diff --git a/aria/modeling/service_template.py b/aria/modeling/service_template.py index 7fab4fc..4663971 100644 --- a/aria/modeling/service_template.py +++ b/aria/modeling/service_template.py @@ -549,9 +549,8 @@ class NodeTemplateBase(TemplateModelMixin): ('requirement_templates', formatting.as_raw_list(self.requirement_templates)))) def instantiate(self, container): - context = ConsumptionContext.get_thread_local() from . import models - name = context.modeling.generate_node_id(self.name) + name = '{name}.{index}'.format(name=self.name, index=len(self.nodes)) node = models.Node(name=name, type=self.type, description=deepcopy_with_locators(self.description), http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/6c25143c/aria/parser/modeling/context.py ---------------------------------------------------------------------- diff --git a/aria/parser/modeling/context.py b/aria/parser/modeling/context.py index dff5991..4a53641 100644 --- a/aria/parser/modeling/context.py +++ b/aria/parser/modeling/context.py @@ -67,11 +67,6 @@ class ModelingContext(object): if self.instance is not None: model_storage.service.put(self.instance) - def generate_node_id(self, template_name): - return self.node_id_format.format( - template=template_name, - id=self.generate_id()) - def generate_id(self): if self.id_type == IdType.LOCAL_SERIAL: return self._serial_id_counter.next()
