It appears that Antergos distributes a modified version of pacman which
adds additional lines while updating its package databases. These are
incorrectly interpreted as available upgrades. This commit checks for
these lines in the output and skips them.
The test that runs these states is testing for behavior that was
obsoleted by virtualenv 13.0. Ensure that we have older virtualenv
available, and then create a venv with that older version. Use the
2nd virtualenv to attempt the "weird" install.
- When writing to a binary file in Python 3, the data type must
be `bytes`.
- `contextlib.nested` is not available in Python 3. Although
`contextlib.ExitStack` is an option (which would require different
code for Python 2 and Python 3 since `contextlib.ExitStack` is not
available in Python 2), it is much simpler just to use separate `with`
statements.
Signed-off-by: Sergey Kizunov <sergey.kizunov@ni.com>
In Python 3, a command such as:
```
salt-call state.apply mystate
```
On certain SLS files (in my case a `py` rendered file) could yield an
error such as:
```
[ERROR ] Data transport is broken, got: #!py
---SLS file contents here---
, type: str, exception: a bytes-like object is required, not 'str',
retry attempts exhausted
```
Change `RemoteClient.get_file` to ensure the `data` passed to `write` is
a `bytes` type in Python 3.
Signed-off-by: Sergey Kizunov <sergey.kizunov@ni.com>
* git.latest: fail gracefully for misconfigured remote repo
When the remote repo's HEAD refers to a nonexistent ref, this was
causing a traceback when we tried to check if the upstream tracking
branch needed to be changed after cloning the repo. This commit fixes
this traceback by gracefully failing the state when the remote HEAD is
not present in the ``git ls-remote`` output, but the desired remote
revision doesn't exist.
Additionally, a similar graceful failure now happens if the state is run
again after we gracefully fail the first time, and we need to set the
tracking branch. Trying to set the tracking branch when there is no
local branch would fail with an ambiguous error like "fatal: branch
'master' does not exist", so before we even attempt to set the tracking
branch, the state is failed with a more descriptive comment.
* Add integration test for #36242
This is possibly causing problems with one of the dockerng unit tests
on Ubuntu 12. Being explicit the use of identical_signature_wrapper
may help clear up some of the mocking problems with backports and
docker.
I also changed the sys.version_info option to use the six.PY2 global.
This is more consistent with other salt files and essentially does the
same thing and avoids an additional import.
When using `fopen`, we need to import all of salt.utils. We should
also be explicit about calling salt.utils.fopen.
This also cleans up the ordering of the salttesting vs salt libs to
be consistent with other files and conform with `ensure_is_syspath`.
Also changes a print statement to a log.info