From: tierno Date: Mon, 6 May 2019 13:24:12 +0000 (+0000) Subject: fix bug 685. Getting unique log name for vim_accounts X-Git-Tag: v6.0.0~20 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F47%2F7447%2F2;p=osm%2FRO.git fix bug 685. Getting unique log name for vim_accounts Change-Id: I3d5c039243d5cad7137beaf4a1b62e467243712d Signed-off-by: tierno --- diff --git a/osm_ro/nfvo.py b/osm_ro/nfvo.py index d433ac96..3ab77cfd 100644 --- a/osm_ro/nfvo.py +++ b/osm_ro/nfvo.py @@ -126,11 +126,12 @@ def get_non_used_vim_name(datacenter_name, datacenter_id, tenant_name, tenant_id if name not in vim_threads["names"]: vim_threads["names"].append(name) return name - name = datacenter_name[:16] + "." + tenant_name[:16] - if name not in vim_threads["names"]: - vim_threads["names"].append(name) - return name - name = datacenter_id + "-" + tenant_id + if tenant_name: + name = datacenter_name[:16] + "." + tenant_name[:16] + if name not in vim_threads["names"]: + vim_threads["names"].append(name) + return name + name = datacenter_id vim_threads["names"].append(name) return name @@ -237,7 +238,7 @@ def start_service(mydb, persistence=None, wim=None): except Exception as e: raise NfvoException("Error at VIM {}; {}: {}".format(vim["type"], type(e).__name__, e), httperrors.Internal_Server_Error) - thread_name = get_non_used_vim_name(vim['datacenter_name'], vim['vim_tenant_id'], vim['vim_tenant_name'], + thread_name = get_non_used_vim_name(vim['datacenter_name'], vim['datacenter_id'], vim['vim_tenant_name'], vim['vim_tenant_id']) new_thread = vim_thread.vim_thread(task_lock, thread_name, vim['datacenter_name'], vim['datacenter_tenant_id'], db=db, db_lock=db_lock, ovim=ovim)