Skip to content

Commit

Permalink
print difference between local and remote allowlist
Browse files Browse the repository at this point in the history
  • Loading branch information
craddm committed Jan 8, 2025
1 parent f3ae0db commit e00d995
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions data_safe_haven/commands/allowlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,23 @@ def upload(
pulumi_config=pulumi_config,
repository=repository,
):
diff = SREAllowlist.remote_diff(
context=context,
sre_config=sre_config,
pulumi_config=pulumi_config,
repository=repository,
allowlist=allowlist,
)
for line in "\n".join(diff).splitlines():
logger.info(line)
if not console.confirm(
f"An allowlist already exists for {repository.name}. Do you want to overwrite it?",
default_to_yes=True,
):
raise typer.Exit()

try:
logger.info(f"Uploading allowlist for {repository.name} to {sre_config.name}")
SREAllowlist.upload(
context=context,
sre_config=sre_config,
Expand Down

0 comments on commit e00d995

Please sign in to comment.