mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Merge branch 'develop' into add-vault-approle
This commit is contained in:
commit
8d7704dca8
@ -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
|
||||
|
@ -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
|
||||
|
@ -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,
|
||||
|
@ -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):
|
||||
'''
|
||||
|
@ -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])
|
||||
|
Loading…
Reference in New Issue
Block a user