yumpkg.list_upgrades returns an empty dictionary when no upgrades are available.
We need to check for this situation and skip the test if no upgrades are present.
Fixes the test failure on Fedora 24 on Jenkins currently, but also protects against
any potential failures for other RHEL-based distros that aren't currently failing
because "ret" is populated with a dictionary of upgrades.
Slave interfaces have some of their parameters overridden before being written
to file, but when Salt is ran in test mode, those overridden values aren't
taken into account. This results in the test run showing that changes will be
applied, even though the configuration hasn't changed at all:
ID: ens2f1
Function: network.managed
Result: None
Comment: Interface ens2f1 is set to be updated:
---
+++
@@ -1,4 +1,3 @@
auto ens2f1
-iface ens2f1 inet manual
- bond-master bond0
+iface ens2f1 inet static
Started: 09:07:41.719716
Duration: 1.91 ms
Changes:
This commit overrides those values in _parse_settings_eth instead of
_write_file_ifaces, so that the test run shows what's really going to be
modified.
glance.image_list now returns a list of images instead of a dict, but
the glance state tried to use the values() method on it either way,
leading to the following exception:
An exception occurred in this state: Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/salt/state.py", line 1733, in call
**cdata['kwargs'])
File "/usr/lib/python2.7/dist-packages/salt/loader.py", line 1652, in wrapper
return f(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/salt/states/glance.py", line 155, in image_present
image, msg = _find_image(name)
File "/usr/lib/python2.7/dist-packages/salt/states/glance.py", line 60, in _find_image
return images_dict.values()[0], 'Found image {0}'.format(name)
AttributeError: 'list' object has no attribute 'values'
This commit makes sure that we're always working with a list, even if
glance.image_list returns a dict.
keystoneclient.apiclient.exceptions has been deprecated since 0.7.1 in
favor of keystoneclient.exceptions, and has been removed in 2.1.0, so
the glance state fails to load with recent versions of keystoneclient.
This commit tries to import from keystoneclient.exceptions first, and
falls back to keystoneclient.apiclient.exceptions if that fails.
Some tests use position number in the argument list of psql command
to check their results. As #36787 add one element, next position
in the list must be used.
This was including the newline which was causing the state modifications present in #36676 to fail in alternatives integration tests which were introduced in 2016.3