+ self._update_ro_accounts()
+
+
+ def _update_ro_accounts(self):
+ get_ro_accounts = self._http.get_cmd('api/operational/{}ro-account'
+ .format(self._client.so_rbac_project_path))
+ if not get_ro_accounts or 'rw-ro-account:ro-account' not in get_ro_accounts:
+ return
+ for account in get_ro_accounts['rw-ro-account:ro-account']['account']:
+ if account['ro-account-type'] == 'openmano':
+ # Refresh the Account Status
+ refresh_body = {"input": {
+ "ro-account": account['name'],
+ "project-name": self._client._so_project
+ }
+ }
+ refresh_status = self._http.post_cmd('api/operations/update-ro-account-status',
+ refresh_body)
+ if refresh_status and 'error' in refresh_status:
+ raise ClientException("Failed to refersh RO Account Status")
+