Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
First, thank you for pyinfra. I have been using pyinfra 2 to manage my personal dev machines after trying fabric and ansible, and really liked it, but with version 3's addition of
_if
, it is perfect for what I need.The only issue I had when switching to 3.x was that the sudo password pompt no longer worked. Pyinfra would ask for the sudo password, but then immediately fail.
The problem was that the connector utility function that handled setting the sudo password was checking to see if
_sudo_password
was in the argument list, but not checking if it was set. Something like (i've shorted some var names)but
a['_sudo_password']
is set toNone
, so the prompted password never get used.The other issue was that the command string that was generated to pass the sudo password to an askpass executable was not quoting the password
which does not work if the password contains special shell characters like `;' or spaces.