@@ -1442,7 +1442,7 @@ def load_dynamic(self, matches):
1442
1442
faux = {'state' : 'file' , 'fun' : 'recurse' }
1443
1443
self .state .module_refresh (faux )
1444
1444
1445
- def render_state (self , sls , env , mods ):
1445
+ def render_state (self , sls , env , mods , matches ):
1446
1446
'''
1447
1447
Render a state file and retrieve all of the include states
1448
1448
'''
@@ -1472,13 +1472,10 @@ def render_state(self, sls, env, mods):
1472
1472
'as a list' .format (sls ))
1473
1473
errors .append (err )
1474
1474
else :
1475
- # Available environments to which this minion belongs
1476
- my_avail = self .top_matches (self .get_top ()).keys ()
1477
-
1478
1475
for inc_sls in state .pop ('include' ):
1479
1476
# Subset of my_avail containing the include sls
1480
1477
my_env = [
1481
- aenv for aenv in my_avail
1478
+ aenv for aenv in matches
1482
1479
if fnmatch .filter (self .avail [aenv ], inc_sls )
1483
1480
]
1484
1481
@@ -1489,7 +1486,8 @@ def render_state(self, sls, env, mods):
1489
1486
nstate , mods , err = self .render_state (
1490
1487
inc_sls ,
1491
1488
my_env [0 ] if len (my_env ) == 1 else env ,
1492
- mods
1489
+ mods ,
1490
+ matches
1493
1491
)
1494
1492
if nstate :
1495
1493
state .update (nstate )
@@ -1500,7 +1498,7 @@ def render_state(self, sls, env, mods):
1500
1498
if not my_env :
1501
1499
msg = ('Unknown include: Specified SLS {0} is not available on the salt master '
1502
1500
'in any available environments {1} '
1503
- ).format (inc_sls , ', ' .join (my_avail ))
1501
+ ).format (inc_sls , ', ' .join (matches ))
1504
1502
elif len (my_env ) > 1 :
1505
1503
msg = ('Ambiguous include: Specified SLS {0} is available on the salt master '
1506
1504
'in available environments {1}'
@@ -1610,7 +1608,7 @@ def render_highstate(self, matches):
1610
1608
mods = set ()
1611
1609
for sls_match in states :
1612
1610
for sls in fnmatch .filter (self .avail [env ], sls_match ):
1613
- state , mods , err = self .render_state (sls , env , mods )
1611
+ state , mods , err = self .render_state (sls , env , mods , matches )
1614
1612
# The extend members can not be treated as globally unique:
1615
1613
if '__extend__' in state and '__extend__' in highstate :
1616
1614
highstate ['__extend__' ].extend (state .pop ('__extend__' ))
0 commit comments