mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #34376 from rallytime/merge-2016.3
[2016.3] Merge forward from 2015.8 to 2016.3
This commit is contained in:
commit
5a44b077a0
5 changed files with 26 additions and 7 deletions
|
@ -200,6 +200,7 @@ def main(argv): # pylint: disable=W0613
|
|||
salt_argv = [
|
||||
sys.executable,
|
||||
salt_call_path,
|
||||
'--retcode-passthrough',
|
||||
'--local',
|
||||
'--metadata',
|
||||
'--out', 'json',
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
#!/usr/bin/env python
|
||||
def myfunction():
|
||||
grains = {}
|
||||
grains['match'] = 'maker'
|
||||
return grains
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue