diff --git a/usr/lib/python3.8/spoc/container.py b/usr/lib/python3.8/spoc/container.py index 6bf1b6a..86215b1 100644 --- a/usr/lib/python3.8/spoc/container.py +++ b/usr/lib/python3.8/spoc/container.py @@ -85,7 +85,10 @@ class Container: try: subprocess.run(['lxc-wait', '-P', config.CONTAINERS_DIR, '-s', awaited_state.value, '-t', '30', self.name], check=True) except subprocess.CalledProcessError: - raise InvalidContainerStateError(self.name, self.get_state()) + # Sometimes LXC decides to return rc 1 even on successful state change + actual_state = self.get_state() + if actual_state != awaited_state: + raise InvalidContainerStateError(self.name, actual_state) def mount_rootfs(self): # Prepares container rootfs