Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues/29643 fix invalid retcode #31164

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions salt/modules/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,8 @@ def high(data, test=False, queue=False, **kwargs):
'is specified.'
)
try:
st_ = salt.state.State(__opts__, pillar, pillar_enc=pillar_enc, proxy=__proxy__)
st_ = salt.state.State(__opts__, pillar, pillar_enc=pillar_enc, proxy=__proxy__,
context=__context__)
except NameError:
st_ = salt.state.State(__opts__, pillar, pillar_enc=pillar_enc)

Expand Down Expand Up @@ -272,7 +273,7 @@ def template(tem, queue=False, **kwargs):
conflict = _check_queue(queue, kwargs)
if conflict is not None:
return conflict
st_ = salt.state.HighState(__opts__)
st_ = salt.state.HighState(__opts__, context=__context__)
if not tem.endswith('.sls'):
tem = '{sls}.sls'.format(sls=tem)
high_state, errors = st_.render_state(tem, saltenv, '', None, local=True)
Expand Down Expand Up @@ -576,6 +577,7 @@ def highstate(test=None,
kwargs.get('__pub_jid'),
pillar_enc=pillar_enc,
proxy=__proxy__,
context=__context__,
mocked=kwargs.get('mock', False))
except NameError:
st_ = salt.state.HighState(opts,
Expand Down Expand Up @@ -768,6 +770,7 @@ def sls(mods,
kwargs.get('__pub_jid'),
pillar_enc=pillar_enc,
proxy=__proxy__,
context=__context__,
mocked=kwargs.get('mock', False))
except NameError:
st_ = salt.state.HighState(opts,
Expand Down Expand Up @@ -881,7 +884,7 @@ def top(topfn,
'is specified.'
)

st_ = salt.state.HighState(opts, pillar, pillar_enc=pillar_enc)
st_ = salt.state.HighState(opts, pillar, pillar_enc=pillar_enc, context=__context__)
st_.push_active()
st_.opts['state_top'] = salt.utils.url.create(topfn)
if saltenv:
Expand Down
5 changes: 4 additions & 1 deletion salt/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,7 @@ def __init__(
jid=None,
pillar_enc=None,
proxy=None,
context=None,
mocked=False,
loader='states'):
self.states_loader = loader
Expand All @@ -650,7 +651,7 @@ def __init__(
)
self._pillar_enc = pillar_enc
self.opts['pillar'] = self._gather_pillar()
self.state_con = {}
self.state_con = context or {}
self.load_modules(proxy=proxy)
self.active = set()
self.mod_init = set()
Expand Down Expand Up @@ -3284,6 +3285,7 @@ def __init__(
jid=None,
pillar_enc=None,
proxy=None,
context=None,
mocked=False,
loader='states'):
self.opts = opts
Expand All @@ -3295,6 +3297,7 @@ def __init__(
jid,
pillar_enc,
proxy=proxy,
context=context,
mocked=mocked,
loader=loader)
self.matcher = salt.minion.Matcher(self.opts)
Expand Down
1 change: 1 addition & 0 deletions salt/transport/zeromq.py
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,7 @@ def destroy(self):
self.stream.io_loop.remove_handler(self.stream.socket)
# set this to None, more hacks for messed up pyzmq
self.stream.socket = None
self.stream = None
self.socket.close()
if self.context.closed is False:
self.context.term()
Expand Down