mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Fix YAML error on minion start
This commit is contained in:
parent
57fbe717b9
commit
66e3624f2b
@ -9,6 +9,7 @@ from __future__ import absolute_import
|
|||||||
|
|
||||||
# Import python libs
|
# Import python libs
|
||||||
import logging
|
import logging
|
||||||
|
from subprocess import check_output
|
||||||
|
|
||||||
# Import third party libs
|
# Import third party libs
|
||||||
import yaml
|
import yaml
|
||||||
@ -25,9 +26,7 @@ def ext_pillar(minion_id, # pylint: disable=W0613
|
|||||||
'''
|
'''
|
||||||
try:
|
try:
|
||||||
command = command.replace('%s', minion_id)
|
command = command.replace('%s', minion_id)
|
||||||
return yaml.safe_load(__salt__['cmd.run']('{0}'.format(command)))
|
return yaml.safe_load(check_output(r'{0}'.format(command), shell=True))
|
||||||
except Exception:
|
except Exception:
|
||||||
log.critical(
|
log.critical('YAML data from {0} failed to parse'.format(command))
|
||||||
'YAML data from {0} failed to parse'.format(command)
|
|
||||||
)
|
|
||||||
return {}
|
return {}
|
||||||
|
@ -990,14 +990,12 @@ class TestDaemon(object):
|
|||||||
TMP_PRODENV_STATE_TREE
|
TMP_PRODENV_STATE_TREE
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
master_opts['ext_pillar'].append(
|
if salt.utils.is_windows():
|
||||||
{'cmd_yaml': 'cat {0}'.format(
|
master_opts['ext_pillar'].append(
|
||||||
os.path.join(
|
{'cmd_yaml': 'type {0}'.format(os.path.join(FILES, 'ext.yaml'))})
|
||||||
FILES,
|
else:
|
||||||
'ext.yaml'
|
master_opts['ext_pillar'].append(
|
||||||
)
|
{'cmd_yaml': 'cat {0}'.format(os.path.join(FILES, 'ext.yaml'))})
|
||||||
)}
|
|
||||||
)
|
|
||||||
|
|
||||||
# We need to copy the extension modules into the new master root_dir or
|
# We need to copy the extension modules into the new master root_dir or
|
||||||
# it will be prefixed by it
|
# it will be prefixed by it
|
||||||
|
Loading…
Reference in New Issue
Block a user