pyinfra icon indicating copy to clipboard operation
pyinfra copied to clipboard

Add windows_file.template operation

Open timeisapear opened this issue 4 years ago • 2 comments

Mostly copy/pasted from file.template. One tweak is making the IO buffer-type bytes since winrm connector _put_file expects a bytes input. Therefore output_file was changed from:

output_file = six.StringIO(output)

to

output_file = six.BytesIO(six.ensure_binary(output))

References https://github.com/Fizzadar/pyinfra/issues/645

I have not added tests yet but may be able to add them later.

timeisapear avatar Aug 23 '21 15:08 timeisapear

Codecov Report

Merging #651 (be8f856) into current (2fec4e3) will decrease coverage by 0.82%. The diff coverage is 87.10%.

:exclamation: Current head be8f856 differs from pull request most recent head 325b214. Consider uploading reports for the commit 325b214 to get more accurate results Impacted file tree graph

@@             Coverage Diff             @@
##           current     #651      +/-   ##
===========================================
- Coverage    92.51%   91.69%   -0.83%     
===========================================
  Files          123      121       -2     
  Lines         7440     7367      -73     
===========================================
- Hits          6883     6755     -128     
- Misses         557      612      +55     
Impacted Files Coverage Δ
pyinfra/api/connectors/winrm.py 52.00% <ø> (+0.51%) :arrow_up:
pyinfra/operations/bsdinit.py 100.00% <ø> (ø)
pyinfra/operations/launchd.py 100.00% <ø> (ø)
pyinfra/operations/systemd.py 100.00% <ø> (ø)
pyinfra/operations/sysvinit.py 100.00% <ø> (ø)
pyinfra/operations/upstart.py 100.00% <ø> (ø)
pyinfra/operations/util/service.py 100.00% <ø> (ø)
pyinfra/api/connectors/sshuserclient/client.py 48.00% <16.66%> (-34.72%) :arrow_down:
pyinfra/operations/windows_files.py 58.33% <24.00%> (-8.07%) :arrow_down:
pyinfra_cli/config.py 44.44% <33.33%> (ø)
... and 69 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 2fec4e3...325b214. Read the comment docs.

codecov[bot] avatar Sep 02 '21 07:09 codecov[bot]

v3 will remove Windows support (into a separate package, https://github.com/pyinfra-dev/pyinfra-windows. Once that's released I shall move this over and close this PR.

Fizzadar avatar Jan 13 '24 10:01 Fizzadar