bug 370 bug 364 Use tenant uuid instead of name for RO NBI

Change-Id: I92b6a36ee109cfb4c63116e5f4b316e42762dd78
Signed-off-by: tierno <alfonso.tiernosepulveda@telefonica.com>
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 @@
                                               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 @@
         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))