From: tierno Date: Wed, 11 Oct 2017 12:25:33 +0000 (+0200) Subject: bug 370 bug 364 Use tenant uuid instead of name for RO NBI X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=3a1237e52deed9a3717bf9055ea8589107d52e8d;p=osm%2Fosmclient.git bug 370 bug 364 Use tenant uuid instead of name for RO NBI Change-Id: I92b6a36ee109cfb4c63116e5f4b316e42762dd78 Signed-off-by: tierno --- 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))