Fix issue in creating services with existing name Up until now, creating a service with a name that already existed resulted in a null service stored in the storage. I noticed it while thinking about tests to the `services list` command.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/c89703f7 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/c89703f7 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/c89703f7 Branch: refs/heads/logger_task Commit: c89703f73752de83519e2f946afd8cbe8ed435a6 Parents: c7ca560 Author: Avia Efrat <[email protected]> Authored: Sun Apr 2 23:27:55 2017 +0300 Committer: Ran Ziv <[email protected]> Committed: Thu Apr 6 11:29:17 2017 +0300 ---------------------------------------------------------------------- aria/core.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/c89703f7/aria/core.py ---------------------------------------------------------------------- diff --git a/aria/core.py b/aria/core.py index f2dfb09..5368f9c 100644 --- a/aria/core.py +++ b/aria/core.py @@ -80,10 +80,8 @@ class Core(object): service.inputs = modeling_utils.create_inputs(inputs, template_inputs) # TODO: now that we have inputs, we should scan properties and inputs and evaluate functions - # first put the service model so it could have an id, as fallback for setting its name - self.model_storage.service.put(service) service.name = service_name or '{0}_{1}'.format(service_template_name, service.id) - self.model_storage.service.update(service) + self.model_storage.service.put(service) return service def delete_service(self, service_name, force=False):
