add __cli for master processes

This commit is contained in:
Daniel Wallace 2018-04-17 15:00:43 -05:00
parent c1dc42e67e
commit 1b1c29bf62
No known key found for this signature in database
GPG key ID: 5FA5E5544F010D48
2 changed files with 3 additions and 1 deletions

View file

@ -3571,6 +3571,8 @@ def apply_master_config(overrides=None, defaults=None):
if overrides:
opts.update(overrides)
opts['__cli'] = os.path.basename(sys.argv[0])
if len(opts['sock_dir']) > len(opts['cachedir']) + 10:
opts['sock_dir'] = os.path.join(opts['cachedir'], '.salt-unix')

View file

@ -280,7 +280,7 @@ def _get_opts(**kwargs):
def _get_initial_pillar(opts):
return __pillar__ if __opts__['__cli'] == 'salt-call' \
return __pillar__ if __opts__.get('__cli', None) == 'salt-call' \
and opts['pillarenv'] == __opts__['pillarenv'] \
else None