Skip to content

Commit 4082dfb

Browse files
author
Nivedithaa Mahendran
committed
fix
1 parent f44cb62 commit 4082dfb

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/mas/devops/users.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,8 @@ def get_user(self, user_id):
231231
verify=self.manage_internal_ca_pem_file_path
232232
)
233233
self.logger.info(f"GET {url} returned {response.status_code}")
234-
self.logger.debug(f"Response: {response.text}")
235-
self.logger.debug(f"Response json: {response.json}")
234+
self.logger.info(f"Response: {response.text}")
235+
self.logger.info(f"Response json: {response.json}")
236236
else:
237237
# For earlier versions, use the Core API v3/users endpoint
238238
url = f"{self.mas_api_url_internal}/v3/users/{user_id}"
@@ -284,7 +284,9 @@ def get_or_create_user(self, payload):
284284
existing_user = self.get_user(user_id)
285285

286286
if existing_user is not None:
287-
self.logger.info(f"Existing user {existing_user['id']} found")
287+
# Log using the appropriate field based on version
288+
user_identifier = existing_user.get('personid') or existing_user.get('id')
289+
self.logger.info(f"Existing user {user_identifier} found")
288290
return existing_user
289291

290292
self.logger.info(f"Creating new user {user_id}")

0 commit comments

Comments
 (0)