You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
salt.states.augeas.change returns None when test=True #37870
Corerelates to code central or existential to SaltP4Priority 4State-Modulebugbroken, incorrect, or confusing behaviorseverity-medium3rd level, incorrect or bad functionality, confusing and lacks a work around
Tested against 2016.3.3 (Boron) using augeas.change with test=True
when running a state with test=True that includes augeas.change None is returned rather than True with a comment including commands that would be run.
This can be seen in the state code (salt/states/augeas.py) on line 267. Looking at the code it does not matter what the contents of the state are - all states will return None when test=True.
This result is in contradiction to what should be returned since there is no test run showing things would be changed as a result of the state being applied. Ideally this would return true and then report which commands would be run to test if a change would be applied.
@fj40crawler good catch. Looks like we need to get this cleaned up on this state to not return None. Any chance you want to take crack at it and push a PR? If not one of our team members can get to it :)
Corerelates to code central or existential to SaltP4Priority 4State-Modulebugbroken, incorrect, or confusing behaviorseverity-medium3rd level, incorrect or bad functionality, confusing and lacks a work around
Activity
Ch3LL commentedon Nov 23, 2016
@fj40crawler good catch. Looks like we need to get this cleaned up on this state to not return None. Any chance you want to take crack at it and push a PR? If not one of our team members can get to it :)
fj40crawler commentedon Nov 24, 2016
yeah, easy fix. Just need to grab a copy and change None to True.
fj40crawler commentedon Nov 24, 2016
Not sure what the deal is here. Have other things I need to do tonight.
Zoe$ git log -m -p -1
commit 1e44a06ac16dd9d19059ad059aa1698e1e6c4319
Author: Daniel Boughton [email protected]
Date: Wed Nov 23 20:35:41 2016 -0500
diff --git a/salt/states/augeas.py b/salt/states/augeas.py
index c9374bf..8321f5e 100644
--- a/salt/states/augeas.py
+++ b/salt/states/augeas.py
@@ -265,7 +265,7 @@ def change(name, context=None, changes=None, lens=None,
filename = re.sub('^/files|/$', '', context)
Zoe$ git push -u origin fix-augeas-return-for-test-true
Username for 'https://github.com': fj40crawler
Password for 'https://[email protected]':
remote: Permission to saltstack/salt.git denied to fj40crawler.
fatal: unable to access 'https://github.com/saltstack/salt/': The requested URL returned error: 403
fj40crawler commentedon Nov 24, 2016
and it whacked the friggin diff. Well one line of change there where ret['result'] = True
Change return value for salt/states/augeas.py to be True instead of N…
fj40crawler commentedon Nov 25, 2016
Pull request is in (finally)
cachedout commentedon Nov 29, 2016
Closed via #37895