mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-09-05 09:35:20 +03:00
Revert container state detection in create()
The _get_container_state() call in create() has no practical effect: Docker's POST /containers/create only creates the container without starting it, so a newly created container can never be in 'running' or 'paused' state.
This commit is contained in:
parent
2adc09604c
commit
4adaba8e8c
@ -588,19 +588,6 @@ class DockerVM(BaseNode):
|
||||
if self._memory > 0:
|
||||
log.info(f"Memory limit set to {self._memory} MB")
|
||||
|
||||
# Check if the container is already running and update the node status accordingly
|
||||
# This can happen when the server restarts and the container continues running
|
||||
try:
|
||||
state = await self._get_container_state()
|
||||
if state == "running":
|
||||
self.status = "started"
|
||||
log.info(f"Docker container '{self._name}' is already running")
|
||||
elif state == "paused":
|
||||
self.status = "suspended"
|
||||
log.info(f"Docker container '{self._name}' is paused")
|
||||
except DockerError as e:
|
||||
log.warning(f"Could not check container state for '{self._name}': {e}")
|
||||
|
||||
return True
|
||||
|
||||
def _format_env(self, variables, env):
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user