seto 2.3.2__tar.gz → 2.4.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. {seto-2.3.2 → seto-2.4.1}/PKG-INFO +1 -1
  2. {seto-2.3.2 → seto-2.4.1}/pyproject.toml +1 -1
  3. {seto-2.3.2 → seto-2.4.1}/seto/core/docker.py +13 -5
  4. {seto-2.3.2 → seto-2.4.1}/LICENSE +0 -0
  5. {seto-2.3.2 → seto-2.4.1}/LICENSE_HEADER.txt +0 -0
  6. {seto-2.3.2 → seto-2.4.1}/README.md +0 -0
  7. {seto-2.3.2 → seto-2.4.1}/seto/__init__.py +0 -0
  8. {seto-2.3.2 → seto-2.4.1}/seto/__main__.py +0 -0
  9. {seto-2.3.2 → seto-2.4.1}/seto/commands/config.py +0 -0
  10. {seto-2.3.2 → seto-2.4.1}/seto/commands/deploy.py +0 -0
  11. {seto-2.3.2 → seto-2.4.1}/seto/commands/down.py +0 -0
  12. {seto-2.3.2 → seto-2.4.1}/seto/commands/mount.py +0 -0
  13. {seto-2.3.2 → seto-2.4.1}/seto/commands/setup.py +0 -0
  14. {seto-2.3.2 → seto-2.4.1}/seto/commands/umount.py +0 -0
  15. {seto-2.3.2 → seto-2.4.1}/seto/commands/volumes.py +0 -0
  16. {seto-2.3.2 → seto-2.4.1}/seto/core/command.py +0 -0
  17. {seto-2.3.2 → seto-2.4.1}/seto/core/dns.py +0 -0
  18. {seto-2.3.2 → seto-2.4.1}/seto/core/driver.py +0 -0
  19. {seto-2.3.2 → seto-2.4.1}/seto/core/network.py +0 -0
  20. {seto-2.3.2 → seto-2.4.1}/seto/core/parser.py +0 -0
  21. {seto-2.3.2 → seto-2.4.1}/seto/core/permissions.py +0 -0
  22. {seto-2.3.2 → seto-2.4.1}/seto/core/shell.py +0 -0
  23. {seto-2.3.2 → seto-2.4.1}/seto/core/swarm.py +0 -0
  24. {seto-2.3.2 → seto-2.4.1}/seto/core/traefik.py +0 -0
  25. {seto-2.3.2 → seto-2.4.1}/seto/core/volume.py +0 -0
  26. {seto-2.3.2 → seto-2.4.1}/seto/drivers/gluster.py +0 -0
  27. {seto-2.3.2 → seto-2.4.1}/seto/drivers/nfs.py +0 -0
  28. {seto-2.3.2 → seto-2.4.1}/seto/shells/local.py +0 -0
  29. {seto-2.3.2 → seto-2.4.1}/seto/shells/remote.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: seto
3
- Version: 2.3.2
3
+ Version: 2.4.1
4
4
  Summary: A Docker Swarm Deployment Manager
5
5
  License: Apache 2.0
6
6
  Keywords: docker,swarm,manager
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
4
4
 
5
5
  [tool.poetry]
6
6
  name = "seto"
7
- version = "2.3.2"
7
+ version = "2.4.1"
8
8
  description = "A Docker Swarm Deployment Manager"
9
9
  keywords = ["docker", "swarm", "manager"]
10
10
  authors = ["Sébastien Demanou <demsking@gmail.com>"]
@@ -14,6 +14,7 @@
14
14
  # ==============================================================================
15
15
  import functools
16
16
  import json
17
+ import socket
17
18
 
18
19
  from docker import DockerClient
19
20
 
@@ -101,6 +102,10 @@ class DockerCompose(Docker):
101
102
  def placement(self) -> str | None:
102
103
  return self.config['x-placement']
103
104
 
105
+ @property
106
+ def current_hostname(self) -> str:
107
+ return socket.gethostname()
108
+
104
109
  @property
105
110
  @functools.lru_cache(maxsize=128)
106
111
  def node_hostname(self) -> str | None:
@@ -136,11 +141,14 @@ class DockerCompose(Docker):
136
141
  self._exec(f'docker compose -p {self.driver.stack_id} -f - down')
137
142
 
138
143
  def _exec(self, command: str) -> None:
139
- Docker.remote_node_run(
140
- command,
141
- hostname=self.node_hostname,
142
- pipe_input=self.resolved_config,
143
- )
144
+ if self.current_hostname == self.node_hostname:
145
+ Shell.pipe_exec(command=command, pipe_input=self.resolved_config)
146
+ else:
147
+ Docker.remote_node_run(
148
+ command,
149
+ hostname=self.node_hostname,
150
+ pipe_input=self.resolved_config,
151
+ )
144
152
 
145
153
 
146
154
  class DockerSwarm(Docker):
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes