Merge branch '2015.8' into '2016.3'

No conflicts.
This commit is contained in:
rallytime 2016-06-29 16:16:46 -06:00
commit 3149da1bcc
5 changed files with 26 additions and 7 deletions

View file

@ -200,6 +200,7 @@ def main(argv): # pylint: disable=W0613
salt_argv = [
sys.executable,
salt_call_path,
'--retcode-passthrough',
'--local',
'--metadata',
'--out', 'json',

View file

@ -299,13 +299,18 @@ def list_nodes(conn=None, call=None):
# so we hide the running vm from being seen as already installed
# do not also mask half configured nodes which are explicitly asked
# to be acted on, on the command line
if (
(call in ['full'] or not hide) and (
(lxcc in names and call in ['action']) or (
call in ['full'])
)
):
nodes[lxcc] = info
if (call in ['full'] or not hide) and ((lxcc in names and call in ['action']) or call in ['full']):
nodes[lxcc] = {
'id': lxcc,
'name': lxcc, # required for cloud cache
'image': None,
'size': linfos['size'],
'state': state.lower(),
'public_ips': linfos['public_ips'],
'private_ips': linfos['private_ips'],
}
else:
nodes[lxcc] = {'id': lxcc, 'state': state.lower()}
return nodes

View file

@ -1439,6 +1439,7 @@ def pkg(pkg_path, pkg_sum, hash_type, test=None, **kwargs):
shutil.rmtree(root)
except (IOError, OSError):
pass
_set_retcode(ret)
return ret

View file

@ -0,0 +1,5 @@
#!/usr/bin/env python
def myfunction():
grains = {}
grains['match'] = 'maker'
return grains

View file

@ -150,6 +150,8 @@ class MatchTest(integration.ShellCase, integration.ShellCaseCommonTestsMixIn):
'''
test salt grain matcher
'''
# Sync grains
self.run_salt('-t1 "*" saltutil.sync_grains')
# First-level grain (string value)
data = self.run_salt('-t 1 -G "test_grain:cheese" test.ping')
data = '\n'.join(data)
@ -159,6 +161,11 @@ class MatchTest(integration.ShellCase, integration.ShellCaseCommonTestsMixIn):
data = '\n'.join(data)
self.assertIn('sub_minion', data)
self.assertNotIn('minion', data.replace('sub_minion', 'stub'))
# Custom grain
data = self.run_salt('-t 1 -G "match:maker" test.ping')
data = '\n'.join(data)
self.assertIn('minion', data)
self.assertIn('sub_minion', data)
# First-level grain (list member)
data = self.run_salt('-t 1 -G "planets:earth" test.ping')
data = '\n'.join(data)