Skip to content

Commit

Permalink
simplify elastic role update
Browse files Browse the repository at this point in the history
  • Loading branch information
byewokko committed Mar 12, 2024
1 parent 620e338 commit 89d5e66
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions seacatauth/batman/elasticsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,7 @@ async def _upsert_role_for_index_access(self, tenant_id: str, privileges: str =
return

# Add access to elasticsearch indices
if not role_data:
role_data = {}
if not role_data.get("indices"):
role_data["indices"] = []
role_data["indices"].append(required_index_settings)
role_data = {"indices": [required_index_settings]}
async with self._elasticsearch_session() as session:
async with session.put(
"{}_security/role/{}".format(random.choice(self.ElasticSearchNodesUrls), role_name), json=role_data
Expand Down

0 comments on commit 89d5e66

Please sign in to comment.