From b4b793f9f3ddb6e6fec93530a37e6f00cf0f4e84 Mon Sep 17 00:00:00 2001 From: tierno Date: Wed, 11 Oct 2017 14:25:33 +0200 Subject: [PATCH] bug 370 bug 364 Use tenant uuid instead of name for RO NBI Change-Id: I92b6a36ee109cfb4c63116e5f4b316e42762dd78 Signed-off-by: tierno --- osmclient/v1/vim.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/osmclient/v1/vim.py b/osmclient/v1/vim.py index f9f8369..d8a9835 100644 --- a/osmclient/v1/vim.py +++ b/osmclient/v1/vim.py @@ -44,8 +44,12 @@ class Vim(object): datacenter['uuid']), vim_account) def _detach(self, vim_name): + tenant_name = 'osm' + tenant = self._get_ro_tenant() + if tenant is None: + raise ClientException("tenant {} not found".format(tenant_name)) return self._ro_http.delete_cmd('openmano/{}/datacenters/{}' - .format('osm', vim_name)) + .format(tenant["uuid"], vim_name)) def create(self, name, vim_access): vim_account = {} @@ -152,6 +156,7 @@ class Vim(object): self._update_ro_accounts() def list(self): + self._update_ro_accounts() if self._client._so_version == 'v3': resp = self._http.get_cmd('v1/api/operational/{}ro-account-state' .format(self._client.so_rbac_project_path)) -- 2.25.1