Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for operation windows_file.template? #7

Open
timeisapear opened this issue Aug 17, 2021 · 1 comment
Open

Support for operation windows_file.template? #7

timeisapear opened this issue Aug 17, 2021 · 1 comment

Comments

@timeisapear
Copy link

Is your feature request related to a problem? Please describe

Perusing the code it appears the windows_file module does not implement the template function, which might be the most immediately useful part of pyinfra for me right off the bat. Am I mistaken and is there a way to use this feature since seemingly the windows_file.put operation just needs to be invoked instead of the file.put at the end of the templating logic?

Describe the solution you'd like

Support template in windows_file operations

@Fizzadar
Copy link
Member

YES this is 100% needed!

timeisapear referenced this issue in timeisapear/pyinfra Aug 23, 2021
Mostly copy/pasted from file.template. One tweak is making the IO buffer-type bytes since
win_rm _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
Fizzadar referenced this issue in timeisapear/pyinfra Jan 23, 2022
Mostly copy/pasted from file.template. One tweak is making the IO buffer-type bytes since
win_rm _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
@Fizzadar Fizzadar transferred this issue from pyinfra-dev/pyinfra Oct 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants