File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -168,7 +168,9 @@ def find_existing_policy(
168168 )
169169
170170 try :
171- search_request = build_policy_search_request (policy_name , persona_qualified_name )
171+ search_request = build_policy_search_request (
172+ policy_name , persona_qualified_name
173+ )
172174 raw_json = client ._call_api (INDEX_SEARCH , request_obj = search_request )
173175 if raw_json and raw_json .get ("entities" ):
174176 return raw_json ["entities" ][0 ]
@@ -191,14 +193,18 @@ async def find_existing_policy_async(
191193 Raises:
192194 ErrorCode.UNABLE_TO_SEARCH_EXISTING_POLICY: if the policy search call fails.
193195 """
194- persona_qualified_name = await get_persona_qualified_name_async (client , persona_guid )
196+ persona_qualified_name = await get_persona_qualified_name_async (
197+ client , persona_guid
198+ )
195199 if not persona_qualified_name :
196200 raise ErrorCode .UNABLE_TO_RESOLVE_PERSONA_QUALIFIED_NAME .exception_with_parameters (
197201 persona_guid
198202 )
199203
200204 try :
201- search_request = build_policy_search_request (policy_name , persona_qualified_name )
205+ search_request = build_policy_search_request (
206+ policy_name , persona_qualified_name
207+ )
202208 raw_json = await client ._call_api (INDEX_SEARCH , request_obj = search_request )
203209 if raw_json and raw_json .get ("entities" ):
204210 return raw_json ["entities" ][0 ]
Original file line number Diff line number Diff line change @@ -115,9 +115,7 @@ def _retry_operation(
115115 # On retries, the preceding sleep gives the index time to propagate an
116116 # entity that was committed server-side before a gateway timeout.
117117 if self ._client :
118- duplicate_response = check_for_duplicate_policy (
119- self ._client , request
120- )
118+ duplicate_response = check_for_duplicate_policy (self ._client , request )
121119 if duplicate_response :
122120 logger .warning (
123121 "DUPLICATE PREVENTED: Policy already exists. "
You can’t perform that action at this time.
0 commit comments