X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osmclient%2Fv1%2Fvim.py;h=b0033a18bcf030efa414382c8cda020c6885e5d6;hb=43b6011cb20d2a7e884d7c9dc9baf6f89e886cba;hp=d8a98355cde6ecf142a8a3a5f117c5cf8a071d16;hpb=b4b793f9f3ddb6e6fec93530a37e6f00cf0f4e84;p=osm%2Fosmclient.git diff --git a/osmclient/v1/vim.py b/osmclient/v1/vim.py index d8a9835..b0033a1 100644 --- a/osmclient/v1/vim.py +++ b/osmclient/v1/vim.py @@ -21,6 +21,7 @@ OSM vim API handling from osmclient.common.exceptions import ClientException from osmclient.common.exceptions import NotFound import json +import time class Vim(object): @@ -155,8 +156,13 @@ class Vim(object): raise ClientException("failed to delete vim {} - {}".format(vim_name, resp)) self._update_ro_accounts() - def list(self): - self._update_ro_accounts() + def list(self, ro_update): + if ro_update: + self._update_ro_accounts() + # the ro_update needs to be made synchronous, for now this works around the issue + # and waits a resonable amount of time for the update to finish + time.sleep(2) + if self._client._so_version == 'v3': resp = self._http.get_cmd('v1/api/operational/{}ro-account-state' .format(self._client.so_rbac_project_path))