external: fix the run as a user flag

there is a hardcoded value of "client.healthchecker"
which needs to be replaced by self.run_as_user

Signed-off-by: parth-gr <partharora1010@gmail.com>
This commit is contained in:
parth-gr
2023-12-13 14:18:42 +05:30
parent c80ea7b644
commit 8d89faf615
@@ -997,8 +997,8 @@ class RadosJSON:
return caps, entity
def get_healthchecker_caps_and_entity(self):
entity = "client.healthchecker"
def get_defaultUser_caps_and_entity(self):
entity = self.run_as_user
caps = {
"mon": "allow r, allow command quorum_status, allow command version",
"mgr": "allow command config",
@@ -1027,7 +1027,7 @@ class RadosJSON:
if "client.healthchecker" in user_name:
if "client.healthchecker" != user_name:
self._arg_parser.restricted_auth_permission = True
return self.get_healthchecker_caps_and_entity()
return self.get_defaultUser_caps_and_entity()
raise ExecutionFailureException(
f"no user found with user_name: {user_name}, "