Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat to enable multiple SCPs #735

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

itsnotsagar
Copy link

Why?

To support more than one SCP per OU

*Issue #724

What?

organizations.py
organisation_policy.py

Description of changes:
organizations.py

  • function create_policy() to handle the updated logic
  • function describe_policy_id_for_target() to handle the updated logic

organisation_policy.py

  • _find_all() renamed to _find_all_paths() with updated filter
  • clubbing _trim_scp_file_name() and _trim_tagging_policy_file_name() into one single function _trim_policy_file_name() with updated logic
  • new function return_policy_name() added which returns the name of the SCP to be created
  • updated clean_and_remove_policy_attachment() function to handle deletion of the newly added policy
  • updated apply() function to handle exceptions and updated logic

By submitting this pull request, I confirm that you can use, modify, copy, and
redistribute this contribution, under the terms of your choice.

@itsnotsagar itsnotsagar changed the title initial commit to enable multiple SCPs feat to enable multiple SCPs May 24, 2024
@javydekoning
Copy link
Contributor

Thanks Sagar, can you please address these minor linter issues?

  src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/organization_policy.py:
  	63: Trailing whitespace
  	183: Wrong amount of left-padding spaces(want multiple of 4)
  src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/organizations.py:
  	183: Trailing whitespace
src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/organization_policy.py:63:0: C0303: Trailing whitespace (trailing-whitespace)
src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/organization_policy.py:176:0: C0301: Line too long (104/100) (line-too-long)
src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/organization_policy.py:192:0: C0301: Line too long (103/100) (line-too-long)
src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/organization_policy.py:67:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/organization_policy.py:70:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/organization_policy.py:73:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
************* Module bootstrap_repository.adf-build.shared.python.organizations
src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/organizations.py:183:0: C0303: Trailing whitespace (trailing-whitespace)
src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/organizations.py:215:0: C0301: Line too long (151/100) (line-too-long)
src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/organizations.py:215:55: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)

@itsnotsagar
Copy link
Author

@javydekoning fixed!

@javydekoning javydekoning added this to the v4.1.0 milestone May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants