mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Allow alternatives.show_link function to work on Suse distros
This should fixup the failing integration.states.alternatives test in 2016.3 as well. The alternatives.install state relies on checking if the output of alternatives.show_link matches the path passed into the state. Since show_link didn't work on suse correctly, the state doesn't install the alternative and returns False.
This commit is contained in:
parent
bdbf1619cb
commit
b8ffd9f53f
1 changed files with 8 additions and 3 deletions
|
@ -76,9 +76,14 @@ def show_link(name):
|
|||
salt '*' alternatives.show_link editor
|
||||
'''
|
||||
|
||||
path = '/var/lib/dpkg/alternatives/{0}'.format(name)
|
||||
if _get_cmd() == 'alternatives':
|
||||
path = '/var/lib/alternatives/{0}'.format(name)
|
||||
if __grains__['os_family'] == 'RedHat':
|
||||
path = '/var/lib/'
|
||||
elif __grains__['os_family'] == 'Suse':
|
||||
path = '/var/lib/rpm/'
|
||||
else:
|
||||
path = '/var/lib/dpkg/'
|
||||
|
||||
path += 'alternatives/{0}'.format(name)
|
||||
|
||||
try:
|
||||
with salt.utils.fopen(path, 'rb') as r_file:
|
||||
|
|
Loading…
Add table
Reference in a new issue