Skip to content

Commit

Permalink
Upload SCP policies with spaces removed (#656)
Browse files Browse the repository at this point in the history
By default Python's `json.dumps` adds a space after `,` and `:` characters. This commit removes those spaces so they don't count against SCP policy limits.
  • Loading branch information
alFReD-NSH committed Oct 30, 2023
1 parent cda2846 commit dec8fab
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def create_policy(
def get_policy_body(path):
bootstrap_path = f"./adf-bootstrap/{path}"
with open(bootstrap_path, mode="r", encoding="utf-8") as policy:
return json.dumps(json.load(policy))
return json.dumps(json.load(policy), separators=(',', ':'))

def list_policies(self, name, policy_type="SERVICE_CONTROL_POLICY"):
response = list(paginator(self.client.list_policies, Filter=policy_type))
Expand Down

0 comments on commit dec8fab

Please sign in to comment.