Skip to content

Commit

Permalink
Bug/issue 230 fetch all users (#189)
Browse files Browse the repository at this point in the history
(cherry picked from commit 56a49800bc53a7723c9c25513c2eea1fda6e40b3)
  • Loading branch information
bhati-pradeep authored and abhijeetkaurav1st committed Mar 6, 2023
1 parent 376f09a commit 3e21b5c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
1 change: 1 addition & 0 deletions calm/dsl/api/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
)
9 changes: 3 additions & 6 deletions calm/dsl/db/table_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
Expand Down

0 comments on commit 3e21b5c

Please sign in to comment.