Skip to content

Commit

Permalink
fix: remove sudo from cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
penglei0 committed Nov 16, 2024
1 parent 8bfd247 commit a43c325
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/containernet/containernet.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ def __init__(self, config: NestedConfig, yaml_base_path: str, oasis_workspace: s

def __check_leaked_mounts(self):
# check whether there are leaked mounts
cmd = "sudo mount | grep -i oasis | wc -l"
cmd = "mount -l | grep -i oasis | wc -l"
result = os.popen(cmd).read()
if int(result) > 0:
logging.warning("Error: there are leaked mounts. %s", result)
cmd = "sudo mount | grep -i 'oasis' | awk -F ' on | type ' '{print $2}' | xargs -I {} sudo umount \"{}\""
logging.warning("Warning: there are leaked mounts. %s", result)
cmd = "mount -l | grep -i 'oasis' | awk -F ' on | type ' '{print $2}' | xargs -I {} sudo umount \"{}\""
os.system(cmd)

def setUp(self) -> None:
Expand Down

0 comments on commit a43c325

Please sign in to comment.