Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Commit

Permalink
Increase default level of feedback/confirmation in destructive commands
Browse files Browse the repository at this point in the history
#1264 (#1283)

Co-authored-by: stas <statis@microsoft.com>
  • Loading branch information
stishkin and stas authored Sep 27, 2021
1 parent 09bdad4 commit d3bcbea
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/cli/onefuzz/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1059,13 +1059,16 @@ def delete(
for container_name in to_keep:
self.logger.info("not removing: %s", container_name)

for container_name in to_delete:
if dryrun:
self.logger.info("container would be deleted: %s", container_name)
elif self.onefuzz.containers.delete(container_name).result:
self.logger.info("removed container: %s", container_name)
else:
self.logger.info("container already removed: %s", container_name)
if len(to_delete) > 0:
for container_name in to_delete:
if dryrun:
self.logger.info("container would be deleted: %s", container_name)
elif self.onefuzz.containers.delete(container_name).result:
self.logger.info("removed container: %s", container_name)
else:
self.logger.info("container already removed: %s", container_name)
else:
self.logger.info("nothing to delete")


class JobTasks(Endpoint):
Expand Down

0 comments on commit d3bcbea

Please sign in to comment.