pyinfra 2.9.2__py2.py3-none-any.whl → 3.0b1__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.
- pyinfra/api/__init__.py +3 -0
- pyinfra/api/arguments.py +261 -255
- pyinfra/api/arguments_typed.py +77 -0
- pyinfra/api/command.py +66 -53
- pyinfra/api/config.py +27 -22
- pyinfra/api/connect.py +1 -1
- pyinfra/api/connectors.py +2 -24
- pyinfra/api/deploy.py +21 -52
- pyinfra/api/exceptions.py +33 -8
- pyinfra/api/facts.py +77 -113
- pyinfra/api/host.py +150 -82
- pyinfra/api/inventory.py +17 -25
- pyinfra/api/operation.py +232 -198
- pyinfra/api/operations.py +102 -148
- pyinfra/api/state.py +137 -79
- pyinfra/api/util.py +55 -70
- pyinfra/connectors/base.py +150 -0
- pyinfra/connectors/chroot.py +160 -169
- pyinfra/connectors/docker.py +227 -237
- pyinfra/connectors/dockerssh.py +231 -253
- pyinfra/connectors/local.py +195 -207
- pyinfra/connectors/ssh.py +528 -615
- pyinfra/connectors/ssh_util.py +114 -0
- pyinfra/connectors/sshuserclient/client.py +5 -3
- pyinfra/connectors/terraform.py +86 -65
- pyinfra/connectors/util.py +212 -137
- pyinfra/connectors/vagrant.py +55 -48
- pyinfra/context.py +3 -2
- pyinfra/facts/docker.py +1 -0
- pyinfra/facts/files.py +45 -32
- pyinfra/facts/git.py +3 -1
- pyinfra/facts/gpg.py +1 -1
- pyinfra/facts/hardware.py +4 -2
- pyinfra/facts/iptables.py +5 -3
- pyinfra/facts/mysql.py +1 -0
- pyinfra/facts/postgres.py +168 -0
- pyinfra/facts/postgresql.py +5 -161
- pyinfra/facts/selinux.py +3 -1
- pyinfra/facts/server.py +77 -30
- pyinfra/facts/systemd.py +29 -12
- pyinfra/facts/sysvinit.py +10 -10
- pyinfra/facts/util/packaging.py +4 -2
- pyinfra/local.py +4 -5
- pyinfra/operations/apk.py +3 -3
- pyinfra/operations/apt.py +25 -47
- pyinfra/operations/brew.py +7 -14
- pyinfra/operations/bsdinit.py +4 -4
- pyinfra/operations/cargo.py +1 -1
- pyinfra/operations/choco.py +1 -1
- pyinfra/operations/dnf.py +4 -4
- pyinfra/operations/files.py +108 -321
- pyinfra/operations/gem.py +1 -1
- pyinfra/operations/git.py +6 -37
- pyinfra/operations/iptables.py +2 -10
- pyinfra/operations/launchd.py +1 -1
- pyinfra/operations/lxd.py +1 -9
- pyinfra/operations/mysql.py +5 -28
- pyinfra/operations/npm.py +1 -1
- pyinfra/operations/openrc.py +1 -1
- pyinfra/operations/pacman.py +3 -3
- pyinfra/operations/pip.py +14 -15
- pyinfra/operations/pkg.py +1 -1
- pyinfra/operations/pkgin.py +3 -3
- pyinfra/operations/postgres.py +347 -0
- pyinfra/operations/postgresql.py +17 -380
- pyinfra/operations/python.py +2 -17
- pyinfra/operations/selinux.py +5 -28
- pyinfra/operations/server.py +59 -84
- pyinfra/operations/snap.py +1 -3
- pyinfra/operations/ssh.py +8 -23
- pyinfra/operations/systemd.py +7 -7
- pyinfra/operations/sysvinit.py +3 -12
- pyinfra/operations/upstart.py +4 -4
- pyinfra/operations/util/__init__.py +12 -0
- pyinfra/operations/util/files.py +2 -2
- pyinfra/operations/util/packaging.py +6 -24
- pyinfra/operations/util/service.py +18 -37
- pyinfra/operations/vzctl.py +2 -2
- pyinfra/operations/xbps.py +3 -3
- pyinfra/operations/yum.py +4 -4
- pyinfra/operations/zypper.py +4 -4
- {pyinfra-2.9.2.dist-info → pyinfra-3.0b1.dist-info}/METADATA +19 -22
- pyinfra-3.0b1.dist-info/RECORD +163 -0
- pyinfra-3.0b1.dist-info/entry_points.txt +11 -0
- pyinfra_cli/__main__.py +2 -0
- pyinfra_cli/commands.py +7 -2
- pyinfra_cli/exceptions.py +83 -42
- pyinfra_cli/inventory.py +19 -4
- pyinfra_cli/log.py +17 -3
- pyinfra_cli/main.py +133 -90
- pyinfra_cli/prints.py +93 -129
- pyinfra_cli/util.py +60 -29
- tests/test_api/test_api.py +2 -0
- tests/test_api/test_api_arguments.py +13 -13
- tests/test_api/test_api_deploys.py +28 -29
- tests/test_api/test_api_facts.py +60 -98
- tests/test_api/test_api_operations.py +100 -200
- tests/test_cli/test_cli.py +18 -49
- tests/test_cli/test_cli_deploy.py +11 -37
- tests/test_cli/test_cli_exceptions.py +50 -19
- tests/test_cli/util.py +1 -1
- tests/test_connectors/test_chroot.py +6 -6
- tests/test_connectors/test_docker.py +4 -4
- tests/test_connectors/test_dockerssh.py +38 -50
- tests/test_connectors/test_local.py +11 -12
- tests/test_connectors/test_ssh.py +66 -107
- tests/test_connectors/test_terraform.py +9 -15
- tests/test_connectors/test_util.py +24 -46
- tests/test_connectors/test_vagrant.py +4 -4
- pyinfra/api/operation.pyi +0 -117
- pyinfra/connectors/ansible.py +0 -171
- pyinfra/connectors/mech.py +0 -186
- pyinfra/connectors/pyinfrawinrmsession/__init__.py +0 -28
- pyinfra/connectors/winrm.py +0 -320
- pyinfra/facts/windows.py +0 -366
- pyinfra/facts/windows_files.py +0 -90
- pyinfra/operations/windows.py +0 -59
- pyinfra/operations/windows_files.py +0 -551
- pyinfra-2.9.2.dist-info/RECORD +0 -170
- pyinfra-2.9.2.dist-info/entry_points.txt +0 -14
- tests/test_connectors/test_ansible.py +0 -64
- tests/test_connectors/test_mech.py +0 -126
- tests/test_connectors/test_winrm.py +0 -76
- {pyinfra-2.9.2.dist-info → pyinfra-3.0b1.dist-info}/LICENSE.md +0 -0
- {pyinfra-2.9.2.dist-info → pyinfra-3.0b1.dist-info}/WHEEL +0 -0
- {pyinfra-2.9.2.dist-info → pyinfra-3.0b1.dist-info}/top_level.txt +0 -0
pyinfra/operations/brew.py
CHANGED
|
@@ -35,7 +35,7 @@ def upgrade():
|
|
|
35
35
|
_upgrade = upgrade # noqa: E305
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
@operation
|
|
38
|
+
@operation()
|
|
39
39
|
def packages(
|
|
40
40
|
packages=None,
|
|
41
41
|
present=True,
|
|
@@ -75,10 +75,10 @@ def packages(
|
|
|
75
75
|
"""
|
|
76
76
|
|
|
77
77
|
if update:
|
|
78
|
-
yield from _update()
|
|
78
|
+
yield from _update._inner()
|
|
79
79
|
|
|
80
80
|
if upgrade:
|
|
81
|
-
yield from _upgrade()
|
|
81
|
+
yield from _upgrade._inner()
|
|
82
82
|
|
|
83
83
|
yield from ensure_packages(
|
|
84
84
|
host,
|
|
@@ -97,10 +97,7 @@ def cask_args(host):
|
|
|
97
97
|
return ("", " --cask") if new_cask_cli(host.get_fact(BrewVersion)) else ("cask ", "")
|
|
98
98
|
|
|
99
99
|
|
|
100
|
-
@operation(
|
|
101
|
-
is_idempotent=False,
|
|
102
|
-
pipeline_facts={"brew_version": ""},
|
|
103
|
-
)
|
|
100
|
+
@operation(is_idempotent=False)
|
|
104
101
|
def cask_upgrade():
|
|
105
102
|
"""
|
|
106
103
|
Upgrades all brew casks.
|
|
@@ -109,9 +106,7 @@ def cask_upgrade():
|
|
|
109
106
|
yield "brew %supgrade%s" % cask_args(host)
|
|
110
107
|
|
|
111
108
|
|
|
112
|
-
@operation(
|
|
113
|
-
pipeline_facts={"brew_version": ""},
|
|
114
|
-
)
|
|
109
|
+
@operation()
|
|
115
110
|
def casks(
|
|
116
111
|
casks=None,
|
|
117
112
|
present=True,
|
|
@@ -143,7 +138,7 @@ def casks(
|
|
|
143
138
|
"""
|
|
144
139
|
|
|
145
140
|
if upgrade:
|
|
146
|
-
yield from cask_upgrade()
|
|
141
|
+
yield from cask_upgrade._inner()
|
|
147
142
|
|
|
148
143
|
args = cask_args(host)
|
|
149
144
|
|
|
@@ -160,7 +155,7 @@ def casks(
|
|
|
160
155
|
)
|
|
161
156
|
|
|
162
157
|
|
|
163
|
-
@operation
|
|
158
|
+
@operation()
|
|
164
159
|
def tap(src=None, present=True, url=None):
|
|
165
160
|
"""
|
|
166
161
|
Add/remove brew taps.
|
|
@@ -219,7 +214,6 @@ def tap(src=None, present=True, url=None):
|
|
|
219
214
|
|
|
220
215
|
if already_tapped:
|
|
221
216
|
yield "brew untap {0}".format(src)
|
|
222
|
-
taps.remove(src)
|
|
223
217
|
return
|
|
224
218
|
|
|
225
219
|
if not present:
|
|
@@ -232,5 +226,4 @@ def tap(src=None, present=True, url=None):
|
|
|
232
226
|
cmd = " ".join([cmd, url])
|
|
233
227
|
|
|
234
228
|
yield cmd
|
|
235
|
-
taps.append(src)
|
|
236
229
|
return
|
pyinfra/operations/bsdinit.py
CHANGED
|
@@ -11,7 +11,7 @@ from . import files
|
|
|
11
11
|
from .util.service import handle_service_control
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
@operation
|
|
14
|
+
@operation()
|
|
15
15
|
def service(
|
|
16
16
|
service,
|
|
17
17
|
running=True,
|
|
@@ -49,9 +49,9 @@ def service(
|
|
|
49
49
|
|
|
50
50
|
# BSD init is simple, just add/remove <service>_enabled="YES"
|
|
51
51
|
if isinstance(enabled, bool):
|
|
52
|
-
yield from files.line(
|
|
53
|
-
"/etc/rc.conf.local",
|
|
54
|
-
"^{0}_enable=".format(service),
|
|
52
|
+
yield from files.line._inner(
|
|
53
|
+
path="/etc/rc.conf.local",
|
|
54
|
+
line="^{0}_enable=".format(service),
|
|
55
55
|
replace='{0}_enable="YES"'.format(service),
|
|
56
56
|
present=enabled,
|
|
57
57
|
)
|
pyinfra/operations/cargo.py
CHANGED
pyinfra/operations/choco.py
CHANGED
pyinfra/operations/dnf.py
CHANGED
|
@@ -35,7 +35,7 @@ def key(src):
|
|
|
35
35
|
yield "rpm --import {0}".format(src)
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
@operation
|
|
38
|
+
@operation()
|
|
39
39
|
def repo(
|
|
40
40
|
src,
|
|
41
41
|
present=True,
|
|
@@ -94,7 +94,7 @@ def repo(
|
|
|
94
94
|
)
|
|
95
95
|
|
|
96
96
|
|
|
97
|
-
@operation
|
|
97
|
+
@operation()
|
|
98
98
|
def rpm(src, present=True):
|
|
99
99
|
# NOTE: if updating this docstring also update `yum.rpm`
|
|
100
100
|
"""
|
|
@@ -130,10 +130,10 @@ def update():
|
|
|
130
130
|
yield "dnf update -y"
|
|
131
131
|
|
|
132
132
|
|
|
133
|
-
_update = update # noqa: E305 (for use below where update is a kwarg)
|
|
133
|
+
_update = update._inner # noqa: E305 (for use below where update is a kwarg)
|
|
134
134
|
|
|
135
135
|
|
|
136
|
-
@operation
|
|
136
|
+
@operation()
|
|
137
137
|
def packages(
|
|
138
138
|
packages=None,
|
|
139
139
|
present=True,
|