diff --git a/calm/dsl/api/user.py b/calm/dsl/api/user.py index 202203c3..52044ce1 100644 --- a/calm/dsl/api/user.py +++ b/calm/dsl/api/user.py @@ -16,4 +16,5 @@ def list(self, params={}, ignore_error=False): request_json=params, method=REQUEST.METHOD.POST, ignore_error=ignore_error, + timeout=(5, 60), ) diff --git a/calm/dsl/db/table_config.py b/calm/dsl/db/table_config.py index 3b8d51b9..f435a84f 100644 --- a/calm/dsl/db/table_config.py +++ b/calm/dsl/db/table_config.py @@ -1866,13 +1866,10 @@ def sync(cls): cls.clear() client = get_api_client() - Obj = get_resource_api("users", client.connection) - res, err = Obj.list({"length": 1000}) - if err: - raise Exception("[{}] - {}".format(err["code"], err["error"])) + entities = client.user.list_all(api_limit=500) + + for entity in entities: - res = res.json() - for entity in res["entities"]: name = entity["status"]["name"] uuid = entity["metadata"]["uuid"] display_name = entity["status"]["resources"].get("display_name") or ""