Skip to content
This repository has been archived by the owner on May 27, 2024. It is now read-only.

Commit

Permalink
Rename output files
Browse files Browse the repository at this point in the history
  • Loading branch information
bastgau committed Feb 29, 2024
1 parent 52948cc commit f135a8b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/snow_revoke_privileges/snow_new_grant_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ def prepare(self) -> None:

for current_object in all_objects:

if current_object in ["DATABASE", "EXTERNAL FUNCTION", "EXTERNAL TABLE"]:
if current_object in ["EXTERNAL FUNCTION", "EXTERNAL TABLE"]:
continue

if current_object in ["SCHEMA"]:
request = f"GRANT USAGE ON SCHEMA {schema['KEY_OBJECT']} TO ROLE {self.settings['new_owner']}"
if current_object in ["SCHEMA", "DATABASE"]:
request = f"GRANT USAGE ON {current_object.upper()} {schema['KEY_OBJECT']} TO ROLE {self.settings['new_owner']}"
self.requests.append(request)
continue

Expand All @@ -57,7 +57,7 @@ def prepare(self) -> None:
def execute(self) -> None:
""""..."""

filename: str = "output-new_grants.txt"
filename: str = "output-new-grants.txt"

if os.path.exists(filename):
os.remove(filename)
Expand Down
2 changes: 1 addition & 1 deletion src/snow_revoke_privileges/snow_revoke_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def __load_configuration(self) -> None:
def execute(self) -> None:
""""..."""

self.__execute_part(self.grant_requests, "grants")
self.__execute_part(self.grant_requests, "revoke-grants")
self.__execute_part(self.ownership_requests, "ownerships")

def __execute_part(self, requests: List[str], request_type: str) -> None:
Expand Down

0 comments on commit f135a8b

Please sign in to comment.