The workaround only needs to be applied to versions of npm newer than 5.1, but
they work with versions newer than 5.0, so just do all newer versions using the
work around
This should not be returning a string type for stderr, since
Popen.communicate() returns a bytestring. In Python 2, the str and bytes
types are the same, but the same is not true in Python 3.
Additionally, the mocking here seems not to consider the fact that Popen
is called when runas is used to get the runas user's environment. Since
this test doesn't care about the output, we can just make the mocked
Popen.communicate() return an empty bytestring.
This test is testing an old version of virtualenv with pip_env, and the version
of pip is 6.x.x, which is too old and doesn't work with the importlib in python
3.6. Skipping this test if python is newer then 3.5.
Allow users to specify a __env__ pillar_root directory that applies
equally to all environments that are not explicitly specified.
fixes#20581
Signed-off-by: Benjamin Drung <benjamin.drung@profitbricks.com>
This makes the following changes:
- The `append_newline` argument to the `file.blockreplace`
remote-execution function has been modified so that if its value is
`None`, it only appends a newline when the content block does not end
in one.
- A couple of fixes were made to newline handling. The existing code
normalized the newlines in the content block, replacing them with
os.linesep. However, when the file contains newlines that don't match
the OS (i.e. POSIX newlines in a file on a Windows box, or Windows
newlines on a Linux/Mac/BSD/etc. box), then we would still end up with
mixed newlines. The line separator is now detected when we read in the
original file, and the detected line separator is used when writing
the content block. Additionally, the same newline mismatch was
possible when appending/prepending the content block. This has been
fixed by using a common function for appending, prepending, and
replacing the content block.
- Support for the `append_newline` argument has been added to the
`file.blockreplace` state. The default value for the state is `None`.
A `versionchanged` has been added to the remote execution function to
let users know that the Fluorine release will change the default value
of that variable.
- 20 new integration tests have been written to test the
`file.blockreplace` state.
We had a similar check to ensure "foo: bar" isn't loaded as a dict, this
adds a check to ensure that we only load lists when there is a leading
bracket.