Merge branch 'develop' into add-vault-approle

This commit is contained in:
slaws 2017-11-28 20:41:40 +01:00 committed by GitHub
commit 8d7704dca8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 21 deletions

View File

@ -560,9 +560,10 @@ def get_configured_provider(vm_=None):
# in all cases, verify that the linked saltmaster is alive.
if data:
ret = _salt('test.ping', salt_target=data['target'])
if not ret:
raise SaltCloudSystemExit(
if ret:
return data
else:
log.error(
'Configured provider {0} minion: {1} is unreachable'.format(
__active_provider_name__, data['target']))
return data
return False

View File

@ -2475,10 +2475,9 @@ def _linux_iqn():
if os.path.isfile(initiator):
with salt.utils.files.fopen(initiator, 'r') as _iscsi:
for line in _iscsi:
if line.find('InitiatorName') != -1:
iqn = line.split('=')
final_iqn = iqn[1].rstrip()
ret.extend([final_iqn])
line = line.strip()
if line.startswith('InitiatorName='):
ret.append(line.split('=', 1)[1])
return ret
@ -2492,9 +2491,10 @@ def _aix_iqn():
aixret = __salt__['cmd.run'](aixcmd)
if aixret[0].isalpha():
iqn = aixret.split()
final_iqn = iqn[1].rstrip()
ret.extend([final_iqn])
try:
ret.append(aixret.split()[1].rstrip())
except IndexError:
pass
return ret
@ -2507,8 +2507,7 @@ def _linux_wwns():
for fcfile in glob.glob('/sys/class/fc_host/*/port_name'):
with salt.utils.files.fopen(fcfile, 'r') as _wwn:
for line in _wwn:
line = line.rstrip()
ret.extend([line[2:]])
ret.append(line.rstrip()[2:])
return ret
@ -2534,8 +2533,7 @@ def _windows_iqn():
for line in cmdret['stdout'].splitlines():
if line[0].isalpha():
continue
line = line.rstrip()
ret.extend([line])
ret.append(line.rstrip())
return ret
@ -2551,7 +2549,6 @@ def _windows_wwns():
cmdret = __salt__['cmd.run_ps'](ps_cmd)
for line in cmdret:
line = line.rstrip()
ret.append(line)
ret.append(line.rstrip())
return ret

View File

@ -392,9 +392,9 @@ def absent(name,
The special keyword used in the job (eg. @reboot, @hourly...).
Quotes must be used, otherwise PyYAML will strip the '@' sign.
'''
### NOTE: The keyword arguments in **kwargs are ignored in this state, but
### cannot be removed from the function definition, otherwise the use
### of unsupported arguments will result in a traceback.
# NOTE: The keyword arguments in **kwargs are ignored in this state, but
# cannot be removed from the function definition, otherwise the use
# of unsupported arguments will result in a traceback.
name = name.strip()
if identifier is False:
@ -566,6 +566,7 @@ def file(name,
user,
group,
mode,
[], # no special attrs for cron
template,
context,
defaults,

View File

@ -57,7 +57,7 @@ class SSHStateTest(SSHCase):
test state.show_top with salt-ssh
'''
ret = self.run_function('state.show_top')
self.assertEqual(ret, {u'base': [u'master_tops_test', u'core']})
self.assertEqual(ret, {u'base': [u'core', u'master_tops_test']})
def test_state_single(self):
'''

View File

@ -477,7 +477,8 @@ PATCHLEVEL = 3
'/proc/meminfo': True
}
_cmd_run_map = {
'dpkg --print-architecture': 'amd64'
'dpkg --print-architecture': 'amd64',
'rpm --eval %{_host_cpu}': 'x86_64'
}
path_exists_mock = MagicMock(side_effect=lambda x: _path_exists_map[x])