This commit is contained in:
2025-12-15 08:35:41 +01:00
parent fe2f9ddd4b
commit d7f202e2b8

View File

@@ -1054,11 +1054,11 @@ class Portainer:
def recreate_container(self,service_id, pull=False): def recreate_container(self,service_id, pull=False):
"""Restart a service on an endpoint.""" """Restart a service on an endpoint."""
path = f"/docker/{self.endpoint_id}/containers/{service_id}/recreate" path = f"/docker/{self.endpoint_id}/containers/{service_id}/recreate"
print(path) #print(path)
params={"pullImage": pull} params={"pullImage": pull}
try: try:
resp = self._api_post(path, json=params, timeout=20) resp = self._api_post(path, json=params, timeout=20)
print(resp) #print(resp)
except ValueError as e: except ValueError as e:
print(f"Error restarting service: {e}") print(f"Error restarting service: {e}")
return [] return []