Skip to content

Commit

Permalink
Working venv deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Campbell committed Sep 17, 2020
1 parent 8bf3836 commit 8b11829
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions utils/venv-manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,25 @@ def create_environment() -> int:
return 15


def delete_environment() -> int:
"""Deletes a virtual environment for webqueue2]
Exit Codes:
0 = Success
5 = Could not delete VENV_DIR
Returns:
int: Exit code
"""
delete_venv_returncode, _ = run_logged_subprocess(f"rm -rf {VENV_DIR}")
if delete_venv_returncode == 0:
logger.info(f"Successfully deleted virtual environment {VENV_DIR} at {VENV_DIR}")
return 0
else:
logger.critical(f"Failed to delete virtual environment {VENV_DIR} at {VENV_DIR}. Exiting")
return 5


if __name__ == "__main__":
args = get_args()
action = args.action
Expand Down

0 comments on commit 8b11829

Please sign in to comment.