Merge branch '2017.7' into merge-oxygen

This commit is contained in:
rallytime 2018-01-28 08:51:03 -05:00
commit ce3902b158
No known key found for this signature in database
GPG key ID: E8F1A4B90D0DEA19
6 changed files with 15 additions and 7 deletions

View file

@ -138583,7 +138583,7 @@ Tests to see if path after expansion is a valid path (file or directory).
Expansion allows usage of ? * and character ranges []. Tilde expansion
is not supported. Returns True/False.
.sp
New in version Hellium.
New in version 2014.7.0.
.sp
CLI Example:

View file

@ -423,7 +423,7 @@ class SaltCMD(salt.utils.parsers.SaltCMDOptionParser):
for host in ret:
if isinstance(ret[host], six.string_types) \
and (ret[host].startswith("Minion did not return")
or ret[host] == 'VALUE TRIMMED'):
or ret[host] == 'VALUE_TRIMMED'):
continue
for fun in ret[host]:
if fun not in docs and ret[host][fun]:

View file

@ -2789,6 +2789,7 @@ def create(vm_=None, call=None):
# Ensure that the latest node data is returned
node = _get_node(instance_id=vm_['instance_id'])
__utils__['cloud.cache_node'](node, __active_provider_name__, __opts__)
ret.update(node)
return ret

View file

@ -3669,7 +3669,7 @@ def path_exists_glob(path):
Expansion allows usage of ? * and character ranges []. Tilde expansion
is not supported. Returns True/False.
.. versionadded:: Hellium
.. versionadded:: 2014.7.0
CLI Example:

View file

@ -2605,7 +2605,8 @@ def request_minion_cachedir(
fname = '{0}.p'.format(minion_id)
path = os.path.join(base, 'requested', fname)
with salt.utils.files.fopen(path, 'w') as fh_:
mode = 'wb' if six.PY3 else 'w'
with salt.utils.files.fopen(path, mode) as fh_:
msgpack.dump(data, fh_)
@ -2715,7 +2716,8 @@ def list_cache_nodes_full(opts=None, provider=None, base=None):
# Finally, get a list of full minion data
fpath = os.path.join(min_dir, fname)
minion_id = fname[:-2] # strip '.p' from end of msgpack filename
with salt.utils.files.fopen(fpath, 'r') as fh_:
mode = 'rb' if six.PY3 else 'r'
with salt.utils.files.fopen(fpath, mode) as fh_:
minions[driver][prov][minion_id] = salt.utils.data.decode(msgpack.load(fh_))
return minions
@ -2891,7 +2893,8 @@ def cache_node_list(nodes, provider, opts):
for node in nodes:
diff_node_cache(prov_dir, node, nodes[node], opts)
path = os.path.join(prov_dir, '{0}.p'.format(node))
with salt.utils.files.fopen(path, 'w') as fh_:
mode = 'wb' if six.PY3 else 'w'
with salt.utils.files.fopen(path, mode) as fh_:
msgpack.dump(nodes[node], fh_)
@ -2916,7 +2919,8 @@ def cache_node(node, provider, opts):
if not os.path.exists(prov_dir):
os.makedirs(prov_dir)
path = os.path.join(prov_dir, '{0}.p'.format(node['name']))
with salt.utils.files.fopen(path, 'w') as fh_:
mode = 'wb' if six.PY3 else 'w'
with salt.utils.files.fopen(path, mode) as fh_:
msgpack.dump(node, fh_)

View file

@ -506,6 +506,9 @@ def __discover_version(saltstack_version):
process = subprocess.Popen(
['git', 'describe', '--tags', '--match', 'v[0-9]*', '--always'], **kwargs)
out, err = process.communicate()
if six.PY3:
out = out.decode()
err = err.decode()
out = out.strip()
err = err.strip()