pyinfra 3.3__py2.py3-none-any.whl → 3.3.1__py2.py3-none-any.whl

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.
@@ -158,6 +158,7 @@ class SSHClient(ParamikoClient):
158
158
  forward_agent,
159
159
  missing_host_key_policy,
160
160
  host_keys_file,
161
+ keep_alive,
161
162
  ) = self.parse_config(
162
163
  hostname,
163
164
  kwargs,
@@ -183,8 +184,6 @@ class SSHClient(ParamikoClient):
183
184
  if _pyinfra_ssh_forward_agent is not None:
184
185
  forward_agent = _pyinfra_ssh_forward_agent
185
186
 
186
- keep_alive = config.get("keep_alive")
187
-
188
187
  if keep_alive:
189
188
  transport = self.get_transport()
190
189
  assert transport is not None, "No transport"
@@ -215,13 +214,14 @@ class SSHClient(ParamikoClient):
215
214
  cfg: dict = {"port": 22}
216
215
  cfg.update(initial_cfg or {})
217
216
 
217
+ keep_alive = 0
218
218
  forward_agent = False
219
219
  missing_host_key_policy = get_missing_host_key_policy(strict_host_key_checking)
220
220
  host_keys_file = path.expanduser("~/.ssh/known_hosts") # OpenSSH default
221
221
 
222
222
  ssh_config = get_ssh_config(ssh_config_file)
223
223
  if not ssh_config:
224
- return hostname, cfg, forward_agent, missing_host_key_policy, host_keys_file
224
+ return hostname, cfg, forward_agent, missing_host_key_policy, host_keys_file, keep_alive
225
225
 
226
226
  host_config = ssh_config.lookup(hostname)
227
227
  forward_agent = host_config.get("forwardagent") == "yes"
@@ -248,7 +248,7 @@ class SSHClient(ParamikoClient):
248
248
  cfg["port"] = int(host_config["port"])
249
249
 
250
250
  if "serveraliveinterval" in host_config:
251
- cfg["keep_alive"] = int(host_config["serveraliveinterval"])
251
+ keep_alive = int(host_config["serveraliveinterval"])
252
252
 
253
253
  if "proxycommand" in host_config:
254
254
  cfg["sock"] = ProxyCommand(host_config["proxycommand"])
@@ -275,7 +275,7 @@ class SSHClient(ParamikoClient):
275
275
  sock = c.gateway(hostname, cfg["port"], target, target_config["port"])
276
276
  cfg["sock"] = sock
277
277
 
278
- return hostname, cfg, forward_agent, missing_host_key_policy, host_keys_file
278
+ return hostname, cfg, forward_agent, missing_host_key_policy, host_keys_file, keep_alive
279
279
 
280
280
  @staticmethod
281
281
  def derive_shorthand(ssh_config, host_string):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyinfra
3
- Version: 3.3
3
+ Version: 3.3.1
4
4
  Summary: pyinfra automates/provisions/manages/deploys infrastructure.
5
5
  Home-page: https://pyinfra.com
6
6
  Author: Nick / Fizzadar
@@ -33,7 +33,7 @@ pyinfra/connectors/terraform.py,sha256=92KwojQKQhqRYuX3UE9ANRvj0Diwg3EEi6blTgu_L
33
33
  pyinfra/connectors/util.py,sha256=Up7kToERfcyjoayY9K6-Xdwjg4-SO2THAy7jzzcznJ8,11651
34
34
  pyinfra/connectors/vagrant.py,sha256=oEeRglzRmemRXW3vilsp_Xg9qnZMRprRJO9fd_C-f5M,4759
35
35
  pyinfra/connectors/sshuserclient/__init__.py,sha256=Qc4RO2wknSWIiNTwOeQ0y2TeiuKHmyWDW2Dz4MOo9CE,44
36
- pyinfra/connectors/sshuserclient/client.py,sha256=z4FpWJ9zX3TNdb1SM4g53m5XByADVSyu2A_oPcalj3I,10489
36
+ pyinfra/connectors/sshuserclient/client.py,sha256=Ei2_mzCMNJopbpvpeLsdSiNb98rxEEy7uCOmpJbfd2o,10506
37
37
  pyinfra/connectors/sshuserclient/config.py,sha256=FZkPrUYXkURZcFUHBGWw9lLC9uiH3DJ0rBYXJePchxw,2774
38
38
  pyinfra/facts/__init__.py,sha256=myTXSOZmAqmU88Fyifn035h9Lr6Gj2mlka_jDcXyKGw,347
39
39
  pyinfra/facts/apk.py,sha256=UEMHzhx2Wx3qq-OcjetWgE2iZ7_EjI-bszLxSN6PJa0,799
@@ -175,13 +175,13 @@ tests/test_connectors/test_docker.py,sha256=0EjkfhCHpLCfL4X-AIdMNw5ASaseY0tbRAn7
175
175
  tests/test_connectors/test_dockerssh.py,sha256=MaC9IK1OZDiqoIsuLOZBJnPDglsMoPDoL19LQtXsyCE,9303
176
176
  tests/test_connectors/test_local.py,sha256=N_FkejDZKu7XLnKeApqfBARYMyxf-hRXCQJrXLHvwRg,7442
177
177
  tests/test_connectors/test_ssh.py,sha256=YeCZtYDogm6M8xSFXjNXXmfgMGOH-0fzTeRaNXyOAtU,42995
178
- tests/test_connectors/test_sshuserclient.py,sha256=Rm1zxSODDXQXuQ3qdkCA12FCUj7Zkgwwe-s2UrsZAoE,8599
178
+ tests/test_connectors/test_sshuserclient.py,sha256=_anSd1cVQGIQkn08RdRbWjnSEkSS5InVkp6_HVvoVYk,8714
179
179
  tests/test_connectors/test_terraform.py,sha256=RZInSjes394eR5CrGGEjzZEFY-UpQj47n4MZH0_ExyY,3779
180
180
  tests/test_connectors/test_util.py,sha256=hQir0WyjH0LEF6xvIyHNyqdI5pkJX6qUR9287MgO2bY,4647
181
181
  tests/test_connectors/test_vagrant.py,sha256=27qRB7ftjEPaj4ejBNZ-rR4Ou1AD1VyVcf2XjwZPG3M,3640
182
- pyinfra-3.3.dist-info/LICENSE.md,sha256=BzCnRYLJv0yb-FJuEd_XOrrQSOEQKzIVo0yHT8taNnM,1076
183
- pyinfra-3.3.dist-info/METADATA,sha256=altc2EhdZvDuH_4Nbn_T4yocK5cA7feHsKONJBvEm4E,8054
184
- pyinfra-3.3.dist-info/WHEEL,sha256=DZajD4pwLWue70CAfc7YaxT1wLUciNBvN_TTcvXpltE,110
185
- pyinfra-3.3.dist-info/entry_points.txt,sha256=BraEFyquy05M8ch33HZXOHoH_m2BTqejL3xX3NrpzOM,471
186
- pyinfra-3.3.dist-info/top_level.txt,sha256=2K6D1mK35JTSEBgOfEPV-N-uA2SDErxGiE0J-HUMMVI,26
187
- pyinfra-3.3.dist-info/RECORD,,
182
+ pyinfra-3.3.1.dist-info/LICENSE.md,sha256=BzCnRYLJv0yb-FJuEd_XOrrQSOEQKzIVo0yHT8taNnM,1076
183
+ pyinfra-3.3.1.dist-info/METADATA,sha256=inqtKGeD5djmhaeEnIH_OhWzMGsxCCiUOE95qGLhORc,8056
184
+ pyinfra-3.3.1.dist-info/WHEEL,sha256=DZajD4pwLWue70CAfc7YaxT1wLUciNBvN_TTcvXpltE,110
185
+ pyinfra-3.3.1.dist-info/entry_points.txt,sha256=BraEFyquy05M8ch33HZXOHoH_m2BTqejL3xX3NrpzOM,471
186
+ pyinfra-3.3.1.dist-info/top_level.txt,sha256=2K6D1mK35JTSEBgOfEPV-N-uA2SDErxGiE0J-HUMMVI,26
187
+ pyinfra-3.3.1.dist-info/RECORD,,
@@ -78,8 +78,10 @@ class TestSSHUserConfigMissing(TestCase):
78
78
  def test_load_ssh_config_no_exist(self):
79
79
  client = SSHClient()
80
80
 
81
- _, config, forward_agent, missing_host_key_policy, host_keys_file = client.parse_config(
82
- "127.0.0.1",
81
+ _, config, forward_agent, missing_host_key_policy, host_keys_file, keep_alive = (
82
+ client.parse_config(
83
+ "127.0.0.1",
84
+ )
83
85
  )
84
86
 
85
87
  assert config.get("port") == 22
@@ -126,8 +128,10 @@ class TestSSHUserConfig(TestCase):
126
128
  def test_load_ssh_config(self):
127
129
  client = SSHClient()
128
130
 
129
- _, config, forward_agent, missing_host_key_policy, host_keys_file = client.parse_config(
130
- "127.0.0.1",
131
+ _, config, forward_agent, missing_host_key_policy, host_keys_file, keep_alive = (
132
+ client.parse_config(
133
+ "127.0.0.1",
134
+ )
131
135
  )
132
136
 
133
137
  assert config.get("key_filename") == ["/id_rsa", "/id_rsa2"]
@@ -144,6 +148,7 @@ class TestSSHUserConfig(TestCase):
144
148
  forward_agent,
145
149
  missing_host_key_policy,
146
150
  host_keys_file,
151
+ keep_alive,
147
152
  ) = client.parse_config("192.168.1.1")
148
153
 
149
154
  assert other_config.get("username") == "otheruser"
@@ -198,7 +203,7 @@ class TestSSHUserConfig(TestCase):
198
203
  client = SSHClient()
199
204
 
200
205
  # Load the SSH config with ProxyJump configured
201
- _, config, forward_agent, _, _ = client.parse_config(
206
+ _, config, forward_agent, _, _, _ = client.parse_config(
202
207
  "192.168.1.2",
203
208
  {"port": 1022},
204
209
  ssh_config_file="other_file",
File without changes