mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix integration.shell.matcher.MatchTest.test_ipcadr
.
Was skipping because of the latest output changes and how output parsing was done.
This commit is contained in:
parent
2f3bb49f83
commit
36955b4560
1 changed files with 4 additions and 11 deletions
|
@ -121,18 +121,11 @@ class MatchTest(integration.ShellCase, integration.ShellCaseCommonTestsMixIn):
|
|||
self.assertIn('sub_minion', data)
|
||||
|
||||
def test_ipcadr(self):
|
||||
subnets_data = self.run_salt('\'*\' network.subnets')
|
||||
subnet = None
|
||||
for line in re.findall(r'{[^}]+}', '\n'.join(subnets_data)):
|
||||
try:
|
||||
yamline = yaml.load(line)
|
||||
subnet = yamline.values()[0][0]
|
||||
break
|
||||
except:
|
||||
continue
|
||||
subnets_data = self.run_salt('--out yaml \'*\' network.subnets')
|
||||
yaml_data = yaml.load('\n'.join(subnets_data))
|
||||
|
||||
if subnet is None:
|
||||
self.skipTest('Failed to query the minion\'s subnets')
|
||||
# We're just after the first defined subnet from 'minion'
|
||||
subnet = yaml_data['minion'][0]
|
||||
|
||||
data = self.run_salt('-S {0} test.ping'.format(subnet))
|
||||
data = '\n'.join(data)
|
||||
|
|
Loading…
Add table
Reference in a new issue