Raise InvalidContainerStateError when await_state fails
This commit is contained in:
parent
44c1a8638d
commit
d4bbce2dcf
@ -73,7 +73,10 @@ class Container:
|
||||
|
||||
def await_state(self, awaited_state):
|
||||
# Block execution until the container reaches the desired state or until timeout
|
||||
try:
|
||||
subprocess.run(['lxc-wait', '-P', CONTAINERS_DIR, '-s', awaited_state.value, '-t', '30', self.name], check=True)
|
||||
except subprocess.CalledProcessError:
|
||||
raise InvalidContainerStateError(self.name, self.get_state())
|
||||
|
||||
def mount_rootfs(self):
|
||||
# Prepares container rootfs
|
||||
|
Loading…
Reference in New Issue
Block a user