mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix test if there the host has multiple subnets.
This commit is contained in:
parent
7e816c291f
commit
cec1cbd477
1 changed files with 2 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
|||
# Import python libs
|
||||
import re
|
||||
import sys
|
||||
import yaml
|
||||
|
||||
|
@ -118,7 +119,7 @@ class MatchTest(integration.ShellCase, integration.ShellCaseCommonTestsMixIn):
|
|||
def test_ipcadr(self):
|
||||
subnets_data = self.run_salt('\'*\' network.subnets')
|
||||
subnet = None
|
||||
for line in subnets_data:
|
||||
for line in re.findall(r'{[^}]+}', '\n'.join(subnets_data)):
|
||||
try:
|
||||
yamline = yaml.load(line)
|
||||
subnet = yamline.values()[0][0]
|
||||
|
|
Loading…
Add table
Reference in a new issue