pyinfra 2.9.2__py2.py3-none-any.whl → 3.0__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.
Files changed (156) hide show
  1. pyinfra/api/__init__.py +3 -0
  2. pyinfra/api/arguments.py +265 -253
  3. pyinfra/api/arguments_typed.py +80 -0
  4. pyinfra/api/command.py +68 -53
  5. pyinfra/api/config.py +139 -32
  6. pyinfra/api/connect.py +1 -1
  7. pyinfra/api/connectors.py +7 -26
  8. pyinfra/api/deploy.py +21 -52
  9. pyinfra/api/exceptions.py +33 -8
  10. pyinfra/api/facts.py +102 -137
  11. pyinfra/api/host.py +150 -82
  12. pyinfra/api/inventory.py +21 -25
  13. pyinfra/api/operation.py +240 -198
  14. pyinfra/api/operations.py +102 -148
  15. pyinfra/api/state.py +137 -79
  16. pyinfra/api/util.py +79 -86
  17. pyinfra/connectors/base.py +147 -0
  18. pyinfra/connectors/chroot.py +160 -169
  19. pyinfra/connectors/docker.py +220 -237
  20. pyinfra/connectors/dockerssh.py +231 -253
  21. pyinfra/connectors/local.py +196 -208
  22. pyinfra/connectors/ssh.py +530 -613
  23. pyinfra/connectors/ssh_util.py +114 -0
  24. pyinfra/connectors/sshuserclient/client.py +5 -3
  25. pyinfra/connectors/terraform.py +86 -65
  26. pyinfra/connectors/util.py +211 -137
  27. pyinfra/connectors/vagrant.py +60 -53
  28. pyinfra/context.py +4 -2
  29. pyinfra/facts/apk.py +2 -0
  30. pyinfra/facts/apt.py +2 -0
  31. pyinfra/facts/brew.py +2 -0
  32. pyinfra/facts/bsdinit.py +2 -0
  33. pyinfra/facts/cargo.py +2 -0
  34. pyinfra/facts/choco.py +2 -0
  35. pyinfra/facts/deb.py +7 -2
  36. pyinfra/facts/dnf.py +2 -0
  37. pyinfra/facts/docker.py +19 -0
  38. pyinfra/facts/files.py +47 -32
  39. pyinfra/facts/gem.py +2 -0
  40. pyinfra/facts/git.py +3 -1
  41. pyinfra/facts/gpg.py +3 -1
  42. pyinfra/facts/hardware.py +34 -24
  43. pyinfra/facts/iptables.py +5 -3
  44. pyinfra/facts/launchd.py +2 -0
  45. pyinfra/facts/lxd.py +2 -0
  46. pyinfra/facts/mysql.py +13 -6
  47. pyinfra/facts/npm.py +1 -0
  48. pyinfra/facts/openrc.py +2 -0
  49. pyinfra/facts/pacman.py +6 -2
  50. pyinfra/facts/pip.py +2 -0
  51. pyinfra/facts/pkg.py +2 -0
  52. pyinfra/facts/pkgin.py +2 -0
  53. pyinfra/facts/postgres.py +168 -0
  54. pyinfra/facts/postgresql.py +6 -160
  55. pyinfra/facts/rpm.py +12 -9
  56. pyinfra/facts/runit.py +68 -0
  57. pyinfra/facts/selinux.py +3 -1
  58. pyinfra/facts/server.py +80 -36
  59. pyinfra/facts/snap.py +2 -0
  60. pyinfra/facts/systemd.py +31 -12
  61. pyinfra/facts/sysvinit.py +10 -10
  62. pyinfra/facts/upstart.py +2 -0
  63. pyinfra/facts/util/packaging.py +7 -4
  64. pyinfra/facts/vzctl.py +2 -0
  65. pyinfra/facts/xbps.py +2 -0
  66. pyinfra/facts/yum.py +2 -0
  67. pyinfra/facts/zypper.py +2 -0
  68. pyinfra/local.py +4 -5
  69. pyinfra/operations/apk.py +6 -4
  70. pyinfra/operations/apt.py +46 -65
  71. pyinfra/operations/brew.py +17 -22
  72. pyinfra/operations/bsdinit.py +9 -7
  73. pyinfra/operations/cargo.py +4 -2
  74. pyinfra/operations/choco.py +4 -2
  75. pyinfra/operations/dnf.py +19 -23
  76. pyinfra/operations/docker.py +339 -0
  77. pyinfra/operations/files.py +188 -386
  78. pyinfra/operations/gem.py +4 -2
  79. pyinfra/operations/git.py +24 -53
  80. pyinfra/operations/iptables.py +29 -35
  81. pyinfra/operations/launchd.py +6 -7
  82. pyinfra/operations/lxd.py +8 -13
  83. pyinfra/operations/mysql.py +62 -81
  84. pyinfra/operations/npm.py +9 -2
  85. pyinfra/operations/openrc.py +6 -4
  86. pyinfra/operations/pacman.py +7 -8
  87. pyinfra/operations/pip.py +25 -24
  88. pyinfra/operations/pkg.py +4 -2
  89. pyinfra/operations/pkgin.py +6 -4
  90. pyinfra/operations/postgres.py +349 -0
  91. pyinfra/operations/postgresql.py +18 -379
  92. pyinfra/operations/puppet.py +3 -1
  93. pyinfra/operations/python.py +8 -19
  94. pyinfra/operations/runit.py +182 -0
  95. pyinfra/operations/selinux.py +47 -44
  96. pyinfra/operations/server.py +111 -127
  97. pyinfra/operations/snap.py +4 -4
  98. pyinfra/operations/ssh.py +20 -33
  99. pyinfra/operations/systemd.py +19 -15
  100. pyinfra/operations/sysvinit.py +9 -16
  101. pyinfra/operations/upstart.py +9 -7
  102. pyinfra/operations/util/__init__.py +12 -0
  103. pyinfra/operations/util/docker.py +177 -0
  104. pyinfra/operations/util/files.py +24 -16
  105. pyinfra/operations/util/packaging.py +55 -57
  106. pyinfra/operations/util/service.py +39 -51
  107. pyinfra/operations/vzctl.py +12 -10
  108. pyinfra/operations/xbps.py +6 -4
  109. pyinfra/operations/yum.py +18 -22
  110. pyinfra/operations/zypper.py +12 -13
  111. pyinfra/version.py +5 -2
  112. {pyinfra-2.9.2.dist-info → pyinfra-3.0.dist-info}/METADATA +40 -41
  113. pyinfra-3.0.dist-info/RECORD +167 -0
  114. {pyinfra-2.9.2.dist-info → pyinfra-3.0.dist-info}/WHEEL +1 -1
  115. pyinfra-3.0.dist-info/entry_points.txt +11 -0
  116. pyinfra_cli/__main__.py +4 -3
  117. pyinfra_cli/commands.py +7 -2
  118. pyinfra_cli/exceptions.py +78 -42
  119. pyinfra_cli/inventory.py +40 -6
  120. pyinfra_cli/log.py +17 -3
  121. pyinfra_cli/main.py +133 -90
  122. pyinfra_cli/prints.py +95 -127
  123. pyinfra_cli/util.py +62 -29
  124. tests/test_api/test_api.py +2 -0
  125. tests/test_api/test_api_arguments.py +13 -13
  126. tests/test_api/test_api_deploys.py +28 -29
  127. tests/test_api/test_api_facts.py +60 -98
  128. tests/test_api/test_api_operations.py +101 -201
  129. tests/test_cli/test_cli.py +18 -49
  130. tests/test_cli/test_cli_deploy.py +11 -37
  131. tests/test_cli/test_cli_exceptions.py +50 -19
  132. tests/test_cli/util.py +1 -1
  133. tests/test_connectors/test_chroot.py +6 -6
  134. tests/test_connectors/test_docker.py +4 -4
  135. tests/test_connectors/test_dockerssh.py +38 -50
  136. tests/test_connectors/test_local.py +11 -12
  137. tests/test_connectors/test_ssh.py +105 -93
  138. tests/test_connectors/test_terraform.py +9 -15
  139. tests/test_connectors/test_util.py +24 -46
  140. tests/test_connectors/test_vagrant.py +7 -7
  141. pyinfra/api/operation.pyi +0 -117
  142. pyinfra/connectors/ansible.py +0 -171
  143. pyinfra/connectors/mech.py +0 -186
  144. pyinfra/connectors/pyinfrawinrmsession/__init__.py +0 -28
  145. pyinfra/connectors/winrm.py +0 -320
  146. pyinfra/facts/windows.py +0 -366
  147. pyinfra/facts/windows_files.py +0 -90
  148. pyinfra/operations/windows.py +0 -59
  149. pyinfra/operations/windows_files.py +0 -551
  150. pyinfra-2.9.2.dist-info/RECORD +0 -170
  151. pyinfra-2.9.2.dist-info/entry_points.txt +0 -14
  152. tests/test_connectors/test_ansible.py +0 -64
  153. tests/test_connectors/test_mech.py +0 -126
  154. tests/test_connectors/test_winrm.py +0 -76
  155. {pyinfra-2.9.2.dist-info → pyinfra-3.0.dist-info}/LICENSE.md +0 -0
  156. {pyinfra-2.9.2.dist-info → pyinfra-3.0.dist-info}/top_level.txt +0 -0
@@ -1,170 +0,0 @@
1
- pyinfra/__init__.py,sha256=7ZcKHGWk7_nYxsYrbFBB_vJr-J-Ddbc56ZS4sk5ArVw,535
2
- pyinfra/__main__.py,sha256=aVd00glLz5CMJGXgt1XxbOvC2HluqaowoTOjxgIpBaA,47
3
- pyinfra/context.py,sha256=7_Fd4Y_ncHRSox68dXndRUWKwtEtnEThvHxTOwK0bSA,3351
4
- pyinfra/local.py,sha256=x4J5Ri0QHYZfNSGpOD2ILH1aaKh4_sLyiW5LAJJ7J-c,2827
5
- pyinfra/progress.py,sha256=X3hXZ4Flh_L9FE4ZEWxWoG0R4dA5UPd1FCO-Exd5Xtc,4193
6
- pyinfra/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
- pyinfra/version.py,sha256=hAgEPHVJVjA2I-rI0gy038UAPVKcmulk-3dZLOmkYrI,153
8
- pyinfra/api/__init__.py,sha256=_gId0L-DYg7A1aofFN5ra--GBE2sq7hpobjL470OhTc,888
9
- pyinfra/api/arguments.py,sha256=FvrXGvhYNqHWrCA8yOK4O2sxKz2YTvOwOCYBOpLs0E0,10285
10
- pyinfra/api/command.py,sha256=s2819TD8bY8FyxWe2hY8Gnq_mgNzot0vFZH8WeUUJS0,7099
11
- pyinfra/api/config.py,sha256=n0E89o2OPQsTifadaJRHZM1qetCJSo59NoCvi_QbUGY,3760
12
- pyinfra/api/connect.py,sha256=mhY-MBwDDX2YAQ3znWLctxsyp0kWqAI2cF4hMDK1Jo4,1417
13
- pyinfra/api/connectors.py,sha256=oBHCG11t6Nj3joOlYaUCCZ1JmjrSNsu0HY54R2dO8Os,1016
14
- pyinfra/api/deploy.py,sha256=2_cij2IrwmPpBa7Hwvc5pFyab9UEUu0zrZ2Le97b5k0,3909
15
- pyinfra/api/exceptions.py,sha256=HgfduYZG02Rwp7GGYxGWQBkxeaiXsZ6XuyV5HvZnIGE,1312
16
- pyinfra/api/facts.py,sha256=ohC_BgYCOVE80LuCpsoccq0J88nwvDjUQvbXV7XCa-g,11226
17
- pyinfra/api/host.py,sha256=hBEOHiHRKk3QcLEtmkXkxO83H66KwYdG1GvXC39j7ew,11473
18
- pyinfra/api/inventory.py,sha256=mVBggjYyqgaNk7jzjyMLAHWZN0OSuCOQILhLUpn_tkM,7785
19
- pyinfra/api/operation.py,sha256=csbUpp7pBR2erfEX4aFgZsO0a43no_83eUm8JSRxT5Q,12637
20
- pyinfra/api/operation.pyi,sha256=RdAJNXhBo5N0V07fxB7V6-kGGG3_ov2EoGtnG_VQ9Lw,3694
21
- pyinfra/api/operations.py,sha256=wn_F3ZPnpAti-ZAdj9YC74RbZXLkIa4NyUu65Uol9Rs,12231
22
- pyinfra/api/state.py,sha256=nNKH2dOiOWicQp1tKXF1hV-1axN5-MmRlz6zo9JXu38,11298
23
- pyinfra/api/util.py,sha256=TI3do-mSBOymdvOgreZqogR0Gz7-CE-pWiJdg1J0-PM,12141
24
- pyinfra/connectors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
- pyinfra/connectors/ansible.py,sha256=Z-L9CN_xHIKiHJa8hvs8lp6wdzCdvheaQbmk-66sJX8,5638
26
- pyinfra/connectors/chroot.py,sha256=hWJ97Z004JWbu7L_4Lq8YorhVJEYI4MvN8sDmpi7c6c,5367
27
- pyinfra/connectors/docker.py,sha256=CQj0b5D0uBycEatipxZAw6uSx8PmKSa27s8ePdaFIAg,8549
28
- pyinfra/connectors/dockerssh.py,sha256=wJfGzvR-CiVZ71ELHbIXcqNdSn1dLfWevpkkOVAKLpE,8504
29
- pyinfra/connectors/local.py,sha256=qA4tCnOc44pBZZx0ycySZrLybeW3bycBOkKMpRUEyr4,6381
30
- pyinfra/connectors/mech.py,sha256=d7cgODl1MwEPUq6Deu3okp4q435bBFFwVZKBpHFcXZg,4454
31
- pyinfra/connectors/ssh.py,sha256=c9dOzfuJeicONYYaeD5pkqMh_Hwoc7nOSiA1VXp3oLs,22111
32
- pyinfra/connectors/terraform.py,sha256=QGolip-PFMU-cnQXnhgNForVA-iIhr0Zx85G9w3_FgE,3099
33
- pyinfra/connectors/util.py,sha256=h4KuDtN80bV4sjebubffX2DWSAdL87_UGy-rm4t5HAQ,9157
34
- pyinfra/connectors/vagrant.py,sha256=EHIY4jklPMDtolJt5eYDlmvFRmX9cE0gvA9QgeMfkAo,4376
35
- pyinfra/connectors/winrm.py,sha256=sXb1_rouefqh7CT94sKw_IswMs71dclRf2_3twJm4m0,10047
36
- pyinfra/connectors/pyinfrawinrmsession/__init__.py,sha256=FbP7zT8Qs9k0pImTGMNzbwuokHbJKfMRHl4Qumav4yc,1113
37
- pyinfra/connectors/sshuserclient/__init__.py,sha256=Qc4RO2wknSWIiNTwOeQ0y2TeiuKHmyWDW2Dz4MOo9CE,44
38
- pyinfra/connectors/sshuserclient/client.py,sha256=UnKmVfAyF0cbmUno5wrvzks3jv6icMgOSs5FpJfzbJU,9606
39
- pyinfra/connectors/sshuserclient/config.py,sha256=UMwkvTgAIS7__re6Wz_pwH6EU4kO1-uMQ5zuFakH0v4,2721
40
- pyinfra/facts/__init__.py,sha256=myTXSOZmAqmU88Fyifn035h9Lr6Gj2mlka_jDcXyKGw,347
41
- pyinfra/facts/apk.py,sha256=2-Hz4I_7iLU06Y0T9_JX5Fo3k_FZpgKNGZ_I5KQGTto,482
42
- pyinfra/facts/apt.py,sha256=zqFSPIAaIgHWWg3eGgL-BDX1aqvgiQ7rNc8QrE1LXLg,1999
43
- pyinfra/facts/brew.py,sha256=POnOx3PWzK1B8pbtkI9wBmYSUsG0IblpwrMHZsMC7Og,2266
44
- pyinfra/facts/bsdinit.py,sha256=sx54RAmS7rjTDzLbUWv86UFtfE8H56qokektf5smN30,490
45
- pyinfra/facts/cargo.py,sha256=C_2NIWcDzT5Y6xxnT5TvuhWpLJCQTqVVXK8biiUvhjI,531
46
- pyinfra/facts/choco.py,sha256=gYdgqglICBn6SStyJvHwQGD8ayo0Zwp5EMiNuYRs5VY,703
47
- pyinfra/facts/deb.py,sha256=v2wSbOIFefY7QrQbXZ584mH_bDW9kzUqozCvZ_5dEgE,1666
48
- pyinfra/facts/dnf.py,sha256=zV_Fx4cq81lyKctDYki65e088kXDAyZiwkEcBDOoLtU,862
49
- pyinfra/facts/docker.py,sha256=fY495U7Fzjk4d7NtuTMg3WkFuQwcckaSRnoSY_E25Vw,1657
50
- pyinfra/facts/files.py,sha256=G85ppmoVwHPfAeMW3ggw6L1cefD0HulJWVytcKVI4u0,11071
51
- pyinfra/facts/gem.py,sha256=bUl8PcXHb5wIw3O4E9YAc0cPzCZQK1IbV_4f3hZht6s,473
52
- pyinfra/facts/git.py,sha256=mctWG78M7my7hT3tvhGr4589nLmvn-CA1gQou4fZf0E,1236
53
- pyinfra/facts/gpg.py,sha256=m1eKQaAEtMKxqScLn5D00ZkZS8hbPdA7GqJWjMQAEaM,3688
54
- pyinfra/facts/hardware.py,sha256=ZX6_v0lyqBNFHc-qtFEhVVQn7VLjLkEtk6EjId9jlc0,11320
55
- pyinfra/facts/iptables.py,sha256=kAK6s8chI86GBKnW58QDPxcb43ZjUQ-Cbec9f9J6ikw,3313
56
- pyinfra/facts/launchd.py,sha256=NtsaAJh0rncopvuawqqv36kOdFsUdpiYS7e5yCGoXeA,668
57
- pyinfra/facts/lxd.py,sha256=uYmqu8vSzfhM0Ymm15pT4IhI4UbRayC23GM6kSYN1mw,337
58
- pyinfra/facts/mysql.py,sha256=E0hWajYz_imRW6WjqeGni3ExQa-s5XziYOM0wypkdIE,5873
59
- pyinfra/facts/npm.py,sha256=c_bU5BoeOfBfZd_qyz2K1ZzzlH_k1VSzjuOiGqC4H8o,674
60
- pyinfra/facts/openrc.py,sha256=IluFop9jskxHnWRJkKlGZZV7nQDOFzhiAMAH0ThyiLo,1350
61
- pyinfra/facts/pacman.py,sha256=SJTdi49nBHk7Gb6ajf2I5PZTHWkqZ_k4npAf695luRs,1001
62
- pyinfra/facts/pip.py,sha256=v6pJCQHOB8DaDgpyrLTz3kKKCSqvLG_zs0uy6_gGOf8,702
63
- pyinfra/facts/pkg.py,sha256=GgRU5x9OWfAfqF-KgJiJz0ndtLKhiRGhtTG4agfunuM,452
64
- pyinfra/facts/pkgin.py,sha256=_rekZJtKLx2TOHd_REJLMDp02typZMpQkZ7sC4FLJSQ,481
65
- pyinfra/facts/postgresql.py,sha256=KHzZGmweUvRgHgnWglDX8qy2PsujmPali-rb3WcYiIQ,4035
66
- pyinfra/facts/rpm.py,sha256=CdC-r2_cfbt81z3sjAE4I-ne46jI-Of6uyDSvELVJfk,1973
67
- pyinfra/facts/selinux.py,sha256=SKBqH2r_Ii0_hjiGX9uiUMY-ZXAvbCrdVpJwLqhrlXQ,4219
68
- pyinfra/facts/server.py,sha256=6VzmhMAUqlbbiaPCc6vXizOmcisgn47z7V4MgpVXXrM,18327
69
- pyinfra/facts/snap.py,sha256=9PYA73ASi-FgBk_y42lGJyETqEgfcJGm-6EFeKzayhE,1910
70
- pyinfra/facts/systemd.py,sha256=AiN9R3BIIp8QJeWFjc18VQQ5DV3uptAX-G_HiF4YWP0,3290
71
- pyinfra/facts/sysvinit.py,sha256=zWFY2f-2YsQlI5ybaD171KG4zfs4CShVeWjJa9L5VZQ,1414
72
- pyinfra/facts/upstart.py,sha256=9mqTYsUpDs7gC5Rest2sQS3EohGXAPjEQUINJWELkW0,543
73
- pyinfra/facts/vzctl.py,sha256=AnRl6SZ7HxMGOVl021v0P37pN4tujbwLFuvxUMOCW_M,591
74
- pyinfra/facts/windows.py,sha256=1ioEHI5GuNqfIAJWlOI2iUxdn7JPANk83uvfyb5PcYs,8664
75
- pyinfra/facts/windows_files.py,sha256=Yi0l8jezgvRJp5JuncDjyBTFbhuMB8hlsrYvBFT15EU,2101
76
- pyinfra/facts/xbps.py,sha256=HBvQ7hvvzC8-Bi952s56Sn4edlOKVITuATpE2sqEPqY,481
77
- pyinfra/facts/yum.py,sha256=h255QEH8VcQTCVdkjwikyk-Pxqzh-dl3Og6a0nMmyVE,827
78
- pyinfra/facts/zypper.py,sha256=O3qoRRh6F6NUP1kEJQ3hE_VJ6C5E8wHPIqZnBthsQcM,766
79
- pyinfra/facts/util/__init__.py,sha256=f7HKu8z9_yFC899ajJ3RFiyivioaZeGfOI6nf9GviCs,521
80
- pyinfra/facts/util/databases.py,sha256=EphGQApzRBXI2nG1FL9h8bozY-o4SgdQgpv9YcnCkxs,730
81
- pyinfra/facts/util/packaging.py,sha256=XosD4S5e0L4OlGdu8gA2sQ-rq0AgYE6eg_l0_MQCNjI,1017
82
- pyinfra/facts/util/win_files.py,sha256=S_IQ5kJD6ZgkEcVHajgh7BIMolLV-1q1ghIcwAS-E1Q,2561
83
- pyinfra/operations/__init__.py,sha256=SOcW337KXIzD_LH-iJJfq14BQcCs5JzwswJ0PIzDgF4,357
84
- pyinfra/operations/apk.py,sha256=JUytx8BBkiYXWYfzsaaTF_7PPDueTYZfpBUBj8B4QZg,2033
85
- pyinfra/operations/apt.py,sha256=_7yRDo-ssqwHVc0jRSrTksDS9JxmrGctYqZa2RRfIeU,14106
86
- pyinfra/operations/brew.py,sha256=GnV15xupsd1gzIqqe-6diNvYommdpQosQzahymnIl0w,5151
87
- pyinfra/operations/bsdinit.py,sha256=L6oXQ7qVaEzLS9rhWUpuI477XZDSriEAxRNq2y8S59U,1559
88
- pyinfra/operations/cargo.py,sha256=j4EoHAdf03Ol2-463J3DljB0RTFPpH6CLB2D2xhSD94,1040
89
- pyinfra/operations/choco.py,sha256=90fUkhHQiUd3pIsvd16rc82ioxsQ8XGW6o8cpYNQPaE,1451
90
- pyinfra/operations/dnf.py,sha256=WouZYNd6sc3KkdO7K8xgm_tkxeI3VqZpxjGq0JvFTTI,5537
91
- pyinfra/operations/files.py,sha256=Nttimy_czhIJ_PJo_NxQ885WSrqfpL7NfgmJnCOhVrI,59563
92
- pyinfra/operations/gem.py,sha256=cxR2g1vHJFSgfCBM1CrCBzRHqlC4aEI2Jczil8jnKJ4,1068
93
- pyinfra/operations/git.py,sha256=nZjFpf2me7Yl1S5WMNJXhdvfY-Fr_JWbP0EXaKB9Eic,12493
94
- pyinfra/operations/iptables.py,sha256=0BZ-ZkvleoVCZWvudd1Ey0aUq0dDwqoDPDxxeb8gS-4,9251
95
- pyinfra/operations/launchd.py,sha256=HXDt3xe-XJ2WNnkHKX5Xi_IY0z8nEV_evW1Y_bC7Qxo,1162
96
- pyinfra/operations/lxd.py,sha256=81-Y4gEAHrZtO9_WBIQ2SCB2bpH4uq2njeEC7tRm0b0,1845
97
- pyinfra/operations/mysql.py,sha256=OP07_InNd7DP4ng8UtngxEnTFsoUz2-zbQKonujDGYw,19968
98
- pyinfra/operations/npm.py,sha256=Kin5Tpkg89CfHcSpxnkxjNaz3_UsB8UOmvbf_Kd36Xs,1402
99
- pyinfra/operations/openrc.py,sha256=joha-j0woTp39ZyGCQu9myldgZ3crfQ7JD0qnJSIhWs,1508
100
- pyinfra/operations/pacman.py,sha256=y9CTZNF1eKr4-8-qzIhMjzntQMLNAieS0GmD030DECM,1656
101
- pyinfra/operations/pip.py,sha256=PxYkqPMrNWavf-7lmb6QW-Yf-uAtrKKKZrkldjNsTTs,5515
102
- pyinfra/operations/pkg.py,sha256=jCBFGHTHLaV7iugT6EI0vfjDTVylm7rhuL4TsLBTGPc,2220
103
- pyinfra/operations/pkgin.py,sha256=fRICyIBK-nk0wV9u3dJ7cu-FqQL0nbDvPbvpQP8MSAg,1914
104
- pyinfra/operations/postgresql.py,sha256=yHFUWQJLB1PnCH_mTDrJOspOwEEagZ34LteFXw2Dd8o,10500
105
- pyinfra/operations/puppet.py,sha256=EOT4RnYro9K6N_HrPvYHd3bZX8rcAQxPNfLcuzm-LqE,797
106
- pyinfra/operations/python.py,sha256=Z1KrJJ-SGAk7lPNiIPh8B4U7z5hPAiUnyNoaGzQRNdY,2398
107
- pyinfra/operations/selinux.py,sha256=WpRuMRVvLK-18LpGlKu3NGSQLUoGzVwiVd4NtuumfdI,6149
108
- pyinfra/operations/server.py,sha256=WUVOBg2P4rCAUxY7-tKiw_UylNIP7WmssyQTOmIZr-A,36485
109
- pyinfra/operations/snap.py,sha256=NAXGEuIa7ObNAb45On8UzA7zVNXQAj_glOgnXXkfBus,3077
110
- pyinfra/operations/ssh.py,sha256=JErimBWP81r_UGWv-7b89FYJL90gqa7e_4Uyql8bHCA,5933
111
- pyinfra/operations/systemd.py,sha256=kI54j-Ft5c3LtqUwQvzGva5aeMHvUQDLUw5Gp36Vxxg,3799
112
- pyinfra/operations/sysvinit.py,sha256=wgKi6uWHJOLC9YqL4qQvBjMZpW0_IIgWSPqvd6JgZ-U,4326
113
- pyinfra/operations/upstart.py,sha256=VXqbieOhwmiwnCjWw2cCe3znXLA9LY3vQKsoXjKwKaE,1887
114
- pyinfra/operations/vzctl.py,sha256=qkWm9oXxDijrVvKpHb1KMTLfz90kOVThwSKGUlfuTqM,2996
115
- pyinfra/operations/windows.py,sha256=_fGBTC44xpa8e2do71kp-ANd4p4gsP2S4tFr7nD_uSk,1660
116
- pyinfra/operations/windows_files.py,sha256=--zxXbfe10BoxyyXbMNGYEjmSPbWIjGUp2x3XvArLCg,16125
117
- pyinfra/operations/xbps.py,sha256=pXz_8Hfuu6DoPyj5hfoTSIEue5yB9ygts66TQ8nT4u4,1430
118
- pyinfra/operations/yum.py,sha256=ag-yDKjz7KD2FzHAJp7f5lO0l1o-lmkTfx8ijoPlDFY,5530
119
- pyinfra/operations/zypper.py,sha256=NW5I81f0Pq8cU8pL6lMXQYLjHP81C0nqpabhyBUTvbw,5481
120
- pyinfra/operations/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
121
- pyinfra/operations/util/files.py,sha256=wuVAJQjoRqXK10dMzdi8qYyaZO-MKRnr1qIOQB8s5Gk,3329
122
- pyinfra/operations/util/packaging.py,sha256=0diFZcK4EtsjRj20SCEfOxLMJSBOHtX7xRRTnLRu4dk,9004
123
- pyinfra/operations/util/service.py,sha256=SW7_vNgWFmMH6S6JMIfThs3gFJaqbPnnIE2b24I6AK4,1990
124
- pyinfra_cli/__init__.py,sha256=G0X7tNdqT45uWuK3aHIKxMdDeCgJ7zHo6vbxoG6zy_8,284
125
- pyinfra_cli/__main__.py,sha256=SqTfTdXr0giSsG5uwTDdP6IXkdW7CO9iMGCqpZefKTA,859
126
- pyinfra_cli/commands.py,sha256=8oEpNR5uHCP_Gy70J5XzBBMyCHWbLkBz3R0foAHV1Tc,1669
127
- pyinfra_cli/exceptions.py,sha256=hG-TvxSNKLmPAGy1InxtZ5vhf8fRv9X8XV5cj7avDW4,3704
128
- pyinfra_cli/inventory.py,sha256=7vu7nJ7uPwgSF-pQT3VI5piYbBQavRQtIrroNpZwMvg,8733
129
- pyinfra_cli/log.py,sha256=edFwQwu9AfEtCPqFBAhBSC6kMt2MGDdVwb4vAVEcYtw,1714
130
- pyinfra_cli/main.py,sha256=NubEIEBwOn3kYxAd5zyOQXWYYkRQdfbOJgEZ0rH4uZ4,18266
131
- pyinfra_cli/prints.py,sha256=e3GJabVzuTYN4rXSLu0w5x4Mlf-kzLlqVCqtunBvZ1I,10426
132
- pyinfra_cli/util.py,sha256=AUGgARL7gwJc3Pia185Y9nDKfn1DB2IpHfH9-Iyvkgw,5374
133
- pyinfra_cli/virtualenv.py,sha256=6j9W54JkQLN02SrZZIVwszp0GxlaaDEUWFZjBDHIWNA,2466
134
- tests/test_api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
135
- tests/test_api/test_api.py,sha256=BjVq93nPIomt_zQW4QZF2gf0VfLpdAnjz0DTzQvOX_g,2295
136
- tests/test_api/test_api_arguments.py,sha256=gTTVAhkXGfUgUygLYsJovG5AuFBIyELgKcPhQnnZWsc,2043
137
- tests/test_api/test_api_command.py,sha256=OW0ESMyS5vo38u17DHeCrSIaIkW9gMU5PSkXL7mRrq0,3204
138
- tests/test_api/test_api_config.py,sha256=bf0mDrUie3On6zGC_hJBpv-wvSf3LHBIBzUDvkopEt0,708
139
- tests/test_api/test_api_deploys.py,sha256=FjBrQOOrdbaLqB0MhsRyV1bOAhdNOPDFRdFKi7ACYbI,4194
140
- tests/test_api/test_api_facts.py,sha256=JtHbZc_w0dDsuovPrvv20m2KBpDRHIO6ce83zQBPXBg,11745
141
- tests/test_api/test_api_host.py,sha256=U_VW2vTl35vR8EdyIGMKr4y0ydsDLbvHSjZDa99CyNE,1119
142
- tests/test_api/test_api_inventory.py,sha256=VLbV0MXdRLOPvTXJF156ne6rAx1cBlFfgq_1S79s4tw,2013
143
- tests/test_api/test_api_operations.py,sha256=PZXEm29ChOdU9V8oOEQy_GAqkzLwlo6pmrXOk9HmjEg,23145
144
- tests/test_api/test_api_util.py,sha256=uHv4oLpoy1_tzOoqFA1zpdvC74SvjitZbxQwp0dmjTs,1716
145
- tests/test_cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
146
- tests/test_cli/test_cli.py,sha256=yokMaDm_vR-vUQweuzr2_GtF8G5xiUfz9vteApEGGY4,6967
147
- tests/test_cli/test_cli_deploy.py,sha256=ug6bRzAsK3yjWCJC55RAIqVGa8jjzOWwXCvqPk7IDsw,5794
148
- tests/test_cli/test_cli_exceptions.py,sha256=jJnmpIC9Q3iLzpwU24x2M01wsOkpPj0iVAW5FFbXCy0,1565
149
- tests/test_cli/test_cli_util.py,sha256=-Ehnj0cO-EkF-6KLxcPPcFeuAUMTz-fKITrxhuiYhV4,2562
150
- tests/test_cli/test_context_objects.py,sha256=JiUTwQP7yvcqA47Kq9jtdsB_Z8nxGMZN46d9pR--FYA,2130
151
- tests/test_cli/util.py,sha256=ePf-jzUoRP7STVYR_fjSgDEjLuyDIn0kZqCt9FHmMvs,315
152
- tests/test_connectors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
153
- tests/test_connectors/test_ansible.py,sha256=CG8_HP2nwUsKv5_rUfwz_q-zauAqljRRnjiwFD8wDSI,2009
154
- tests/test_connectors/test_chroot.py,sha256=pN5nfek2sxipmW-AKIhv6bgNeNSPS2Fmgnio4-7M140,5904
155
- tests/test_connectors/test_docker.py,sha256=v2mx9zi7NTaIs9Hh44QUFpZCyl4Fv9MmbWTwYrLd01k,6563
156
- tests/test_connectors/test_dockerssh.py,sha256=JrgeTQeL5x6xcmGvVnJUpOdrMJYSFOus6DkAM0Ud5gk,9438
157
- tests/test_connectors/test_local.py,sha256=0xCof7aKtB2v3SkwaHHGnKem_94VmQ5JvNMVgQcYOqw,7494
158
- tests/test_connectors/test_mech.py,sha256=Icwp8Cko9SVR7A3hHHP5rujybOEDJvaR3Bjt2xbgijM,4307
159
- tests/test_connectors/test_ssh.py,sha256=zohGriKVgZXDi9qVbnXd4VKnZ8RNYF5GH-JxbMttIts,39545
160
- tests/test_connectors/test_sshuserclient.py,sha256=2PQNLPhNL6lBACc6tQuXmPoog-9L6AdDQNrA-rEw1_8,5734
161
- tests/test_connectors/test_terraform.py,sha256=5wTv2nsuNEIzEZ90s3UzzEhss_pOJJf_DFS2Bl40MEE,3751
162
- tests/test_connectors/test_util.py,sha256=jige6adjbohnu9GXlHA3o2iPJZwxVXssRP974hz83f0,5195
163
- tests/test_connectors/test_vagrant.py,sha256=3ykACWTSvcRiiaooMrPplLtxF3AhJ8FTVJu0ShWbk8Q,3542
164
- tests/test_connectors/test_winrm.py,sha256=Cx_hNYIGUU6sgTDWrd-_ADzrt63a2Qyp4NUV3irS61k,2466
165
- pyinfra-2.9.2.dist-info/LICENSE.md,sha256=gwC95tUll0gwB32tHNkTAasN7Sb6vjWzXa305NwClbI,1076
166
- pyinfra-2.9.2.dist-info/METADATA,sha256=pwK8ZD-SmMlDKbgNOw_ppscghWUoA6GFpMExpDJoG38,8375
167
- pyinfra-2.9.2.dist-info/WHEEL,sha256=P2T-6epvtXQ2cBOE_U1K4_noqlJFN3tj15djMgEu4NM,110
168
- pyinfra-2.9.2.dist-info/entry_points.txt,sha256=OuwjS6QP-HybqPovfhcfM4Oh_1IuJT92orRY6hX8tDk,439
169
- pyinfra-2.9.2.dist-info/top_level.txt,sha256=2K6D1mK35JTSEBgOfEPV-N-uA2SDErxGiE0J-HUMMVI,26
170
- pyinfra-2.9.2.dist-info/RECORD,,
@@ -1,14 +0,0 @@
1
- [console_scripts]
2
- pyinfra = pyinfra_cli.__main__:execute_pyinfra
3
-
4
- [pyinfra.connectors]
5
- ansible = pyinfra.connectors.ansible
6
- chroot = pyinfra.connectors.chroot
7
- docker = pyinfra.connectors.docker
8
- dockerssh = pyinfra.connectors.dockerssh
9
- local = pyinfra.connectors.local
10
- mech = pyinfra.connectors.mech
11
- ssh = pyinfra.connectors.ssh
12
- terraform = pyinfra.connectors.terraform
13
- vagrant = pyinfra.connectors.vagrant
14
- winrm = pyinfra.connectors.winrm
@@ -1,64 +0,0 @@
1
- from os import path
2
- from unittest import TestCase
3
-
4
- from pyinfra.api.exceptions import InventoryError
5
- from pyinfra.connectors.ansible import make_names_data
6
-
7
- TEST_DATA = [
8
- ("mail.example.com", {}, ["all"]),
9
- ("foo.example.com", {}, ["all", "webservers"]),
10
- ("bar.example.com", {}, ["all", "webservers"]),
11
- ("one.example.com", {}, ["all", "dbservers"]),
12
- ("two.example.com", {}, ["all", "dbservers"]),
13
- ("three.example.com", {}, ["all", "dbservers"]),
14
- ]
15
-
16
-
17
- class TestAnsibleConnector(TestCase):
18
- def test_make_names_data_no_file(self):
19
- with self.assertRaises(InventoryError):
20
- make_names_data(inventory_filename="/not/a/file")
21
-
22
- def test_make_names_data_ini(self):
23
- data = make_names_data(
24
- inventory_filename=path.join(
25
- "tests",
26
- "deploy",
27
- "inventories",
28
- "inventory_ansible",
29
- ),
30
- )
31
-
32
- test_data = [
33
- ("webserver-1.net", {}, ["web_and_db_servers", "webservers"]),
34
- ("webserver-2.net", {}, ["web_and_db_servers", "webservers"]),
35
- ("webserver-3.net", {}, ["web_and_db_servers", "webservers"]),
36
- ("dbserver-01.net", {}, ["dbservers", "web_and_db_servers"]),
37
- ("dbserver-02.net", {}, ["dbservers", "web_and_db_servers"]),
38
- ]
39
-
40
- assert sorted(data) == sorted(test_data)
41
-
42
- def test_make_names_data_json(self):
43
- data = make_names_data(
44
- inventory_filename=path.join(
45
- "tests",
46
- "deploy",
47
- "inventories",
48
- "inventory_ansible.json",
49
- ),
50
- )
51
-
52
- assert sorted(data) == sorted(TEST_DATA)
53
-
54
- def test_make_names_data_yaml(self):
55
- data = make_names_data(
56
- inventory_filename=path.join(
57
- "tests",
58
- "deploy",
59
- "inventories",
60
- "inventory_ansible.yml",
61
- ),
62
- )
63
-
64
- assert sorted(data) == sorted(TEST_DATA)
@@ -1,126 +0,0 @@
1
- import json
2
- from unittest import TestCase
3
- from unittest.mock import mock_open, patch
4
-
5
- from pyinfra.api.exceptions import InventoryError
6
- from pyinfra.connectors.mech import get_mech_options, make_names_data
7
-
8
- FAKE_MECH_OPTIONS = {
9
- "groups": {
10
- "ubuntu16": ["mygroup"],
11
- },
12
- "data": {
13
- "centos7": {
14
- "somedata": "somevalue",
15
- },
16
- },
17
- }
18
- FAKE_MECH_OPTIONS_DATA = json.dumps(FAKE_MECH_OPTIONS)
19
-
20
-
21
- def fake_mech_shell(command, splitlines=None):
22
- if command == "mech ls":
23
- return [
24
- "NAME ADDRESS BOX VERSION PATH", # noqa: E501
25
- "ubuntu16 192.168.2.226 bento/ubuntu-16.04 201912.04.0 /Users/bob/somedir/ubuntu16", # noqa: E501
26
- "centos7 192.168.2.227 bento/centos-7 201912.05.0 /Users/bob/somedir/centos7", # noqa: E501
27
- "centos6 poweroff bento/centos-6 201912.04.0 /Users/bob/somedir/centos6", # noqa: E501
28
- "fedora31 bento/fedora-31 201912.04.0 /Users/bob/somedir/fedora31", # noqa: E501
29
- ]
30
- if command == "mech ssh-config ubuntu16":
31
- return [
32
- "Host ubuntu16",
33
- " User vagrant",
34
- " Port 22",
35
- " UserKnownHostsFile /dev/null",
36
- " StrictHostKeyChecking no",
37
- " PasswordAuthentication no",
38
- " IdentityFile path/to/key",
39
- " IdentitiesOnly yes",
40
- " LogLevel FATAL",
41
- " HostName 192.168.2.226",
42
- "",
43
- ]
44
- if command == "mech ssh-config centos7":
45
- return [
46
- "Host centos7",
47
- " User vagrant",
48
- " Port 22",
49
- " UserKnownHostsFile /dev/null",
50
- " StrictHostKeyChecking no",
51
- " PasswordAuthentication no",
52
- " IdentityFile path/to/key",
53
- " IdentitiesOnly yes",
54
- " LogLevel FATAL",
55
- " HostName 192.168.2.227",
56
- "",
57
- ]
58
- if command == "mech ssh-config centos6":
59
- return [
60
- "ERROR: Error: The virtual machine is not powered on: /Users/bob/debian8/.mech/debian-8.11-amd64.vmx", # noqa: E501
61
- "This Mech machine is reporting that it is not yet ready for SSH. Make",
62
- "sure your machine is created and running and try again. Additionally,",
63
- "check the output of `mech status` to verify that the machine is in the",
64
- "state that you expect.",
65
- ]
66
-
67
- return []
68
-
69
-
70
- @patch("pyinfra.connectors.mech.local.shell", fake_mech_shell)
71
- class TestMechConnector(TestCase):
72
- def tearDown(self):
73
- get_mech_options.cache = {}
74
-
75
- @patch(
76
- "pyinfra.connectors.mech.open",
77
- mock_open(read_data=FAKE_MECH_OPTIONS_DATA),
78
- create=True,
79
- )
80
- @patch("pyinfra.connectors.mech.path.exists", lambda path: True)
81
- def test_make_names_data_with_options(self):
82
- data = make_names_data()
83
-
84
- assert data == [
85
- (
86
- "@mech/ubuntu16",
87
- {
88
- "ssh_port": "22",
89
- "ssh_user": "vagrant",
90
- "ssh_hostname": "192.168.2.226",
91
- "ssh_key": "path/to/key",
92
- },
93
- ["mygroup", "@mech"],
94
- ),
95
- (
96
- "@mech/centos7",
97
- {
98
- "ssh_port": "22",
99
- "ssh_user": "vagrant",
100
- "ssh_hostname": "192.168.2.227",
101
- "ssh_key": "path/to/key",
102
- "somedata": "somevalue",
103
- },
104
- ["@mech"],
105
- ),
106
- ]
107
-
108
- def test_make_names_data_with_limit(self):
109
- data = make_names_data(limit=("ubuntu16",))
110
-
111
- assert data == [
112
- (
113
- "@mech/ubuntu16",
114
- {
115
- "ssh_port": "22",
116
- "ssh_user": "vagrant",
117
- "ssh_hostname": "192.168.2.226",
118
- "ssh_key": "path/to/key",
119
- },
120
- ["@mech"],
121
- ),
122
- ]
123
-
124
- def test_make_names_data_no_matches(self):
125
- with self.assertRaises(InventoryError):
126
- make_names_data(limit="nope")
@@ -1,76 +0,0 @@
1
- from unittest import TestCase
2
- from unittest.mock import MagicMock, patch
3
-
4
- from pyinfra.api import Config, State
5
- from pyinfra.api.connect import connect_all
6
-
7
- from ..util import make_inventory
8
-
9
-
10
- class TestWinrmConnector(TestCase):
11
- def setUp(self):
12
- self.fake_connect_patch = patch("pyinfra.connectors.winrm.connect")
13
- self.fake_connect_mock = self.fake_connect_patch.start()
14
-
15
- def tearDown(self):
16
- self.fake_connect_patch.stop()
17
-
18
- def test_connect_host(self):
19
- inventory = make_inventory(hosts=[("@winrm/somehost", {})])
20
- state = State(inventory, Config())
21
- host = inventory.get_host("@winrm/somehost")
22
- host.connect(reason=True)
23
- assert len(state.active_hosts) == 0
24
- assert host.data.winrm_hostname == "somehost"
25
-
26
- def test_connect_all_password(self):
27
- inventory = make_inventory(
28
- hosts=(
29
- ("@winrm/somehost", {"winrm_username": "testuser", "winrm_password": "testpass"}),
30
- (
31
- "@winrm/anotherhost",
32
- {"winrm_username": "testuser2", "winrm_password": "testpass2"},
33
- ),
34
- ),
35
- )
36
- state = State(inventory, Config())
37
- connect_all(state)
38
-
39
- # Get a host
40
- somehost = inventory.get_host("@winrm/somehost")
41
- assert somehost.data.winrm_username == "testuser"
42
- assert somehost.data.winrm_password == "testpass"
43
-
44
- assert len(state.active_hosts) == 2
45
-
46
- def test_run_shell_command(self):
47
- fake_winrm_session = MagicMock()
48
-
49
- fake_winrm = MagicMock()
50
- fake_stdin = MagicMock()
51
- fake_stdout = MagicMock()
52
- fake_winrm.run_cmd.return_value = fake_stdin, fake_stdout, MagicMock()
53
-
54
- fake_winrm_session.return_value = fake_winrm
55
-
56
- inventory = make_inventory(hosts=("@winrm/somehost",))
57
- State(inventory, Config())
58
- host = inventory.get_host("@winrm/somehost")
59
- host.connect()
60
-
61
- command = "echo hi"
62
-
63
- out = host.run_shell_command(command, stdin="hello", print_output=True)
64
- assert len(out) == 3
65
-
66
- status, stdout, stderr = out
67
- # TODO: assert status is True
68
-
69
- combined_out = host.run_shell_command(
70
- command,
71
- print_output=True,
72
- return_combined_output=True,
73
- )
74
- assert len(combined_out) == 2
75
-
76
- # TODO: fake_winrm.run_shell_command.assert_called_with("'echo hi'", get_pty=False)