Skip to content

Change return value for salt/states/augeas.py to be True instead of N… - #37895

Merged
cachedout merged 3 commits into
saltstack:2016.3from
fj40crawler:fix-augeas-return-for-test
Nov 28, 2016
Merged

cachedout merged 3 commits into
saltstack:2016.3from
fj40crawler:fix-augeas-return-for-test

Conversation

@fj40crawler

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes return value for augeas.changes from None to True when salt is run with test=True

What issues does this PR fix or reference?

#37870

Previous Behavior

salt-call state.apply my.augeas.state test=True returns 'None' with the list of commands to be run.

New Behavior

salt-call state.apply my.augeas.state test=True returns 'True' with the list of commands to be run.

Tests written?

No. Tested with existing state file.

…one for cases where salt is run with test=True. Fixes saltstack#37870
@cachedout

Copy link
Copy Markdown
Contributor

This has a failing test. However, I suspect this test may have been written incorrectly to begin with. Could you take a look please and adjust it if necessary? https://jenkins.saltstack.com/job/PR/job/salt-pr-rs-cent7-n/7181/testReport/junit/unit.states.augeas_test/AugeasTestCase/test_change_in_test_mode/

@fj40crawler

fj40crawler commented Nov 27, 2016 •

Copy link
Copy Markdown
Contributor Author

Sorry about that - first time modifying salt. I have updated the unit test to also check for True v.s. None. That should get the test working again.

Zoe$ python ./tests/runtests.py -n unit.states.augeas_test -v

 * Transplanting configuration files to '/tmp/salt-tests-tmpdir/config'
 * Current Directory: /home/danb/netsrc/salt
 * Test suite is running under PID 18342
 * Logging tests on /tmp/salt-runtests.log
Starting unit.states.augeas_test Tests

test_change_in_test_mode (unit.states.augeas_test.AugeasTestCase)
[CPU:22.1%|MEM:66.9%|Z:0] ... ok
test_change_no_context_with_full_path_fail (unit.states.augeas_test.AugeasTestCase)
[CPU:33.3%|MEM:66.9%|Z:0] ... ok
test_change_no_context_with_full_path_multiple_files (unit.states.augeas_test.AugeasTestCase)
[CPU:12.5%|MEM:66.9%|Z:0] ... ok
test_change_no_context_with_full_path_pass (unit.states.augeas_test.AugeasTestCase)
[CPU:25.0%|MEM:66.9%|Z:0] ... ok
test_change_no_context_without_full_path (unit.states.augeas_test.AugeasTestCase)
[CPU:25.0%|MEM:66.8%|Z:0] ... ok
test_change_no_context_without_full_path_invalid_change (unit.states.augeas_test.AugeasTestCase)
[CPU:30.0%|MEM:66.8%|Z:0] ... ok
test_change_no_context_without_full_path_invalid_cmd (unit.states.augeas_test.AugeasTestCase)
[CPU:40.0%|MEM:66.8%|Z:0] ... ok
test_change_non_list_changes (unit.states.augeas_test.AugeasTestCase)
[CPU:11.1%|MEM:66.8%|Z:0] ... ok
test_change_non_list_load_path (unit.states.augeas_test.AugeasTestCase)
[CPU:33.3%|MEM:66.8%|Z:0] ... ok
test_change_with_context_without_full_path_fail (unit.states.augeas_test.AugeasTestCase)
[CPU:0.0%|MEM:66.8%|Z:0] ... ok
test_change_with_context_without_old_file (unit.states.augeas_test.AugeasTestCase)
[CPU:36.4%|MEM:66.9%|Z:0] ... ok


Ran 11 tests in 0.191s

OK

============================ Overall Tests Report ============================
*** No Problems Found While Running Tests ************************************

OK (total=11, skipped=0, passed=11, failures=0, errors=0)
============================ Overall Tests Report ============================

@cachedout
cachedout merged commit c03b389 into saltstack:2016.3 Nov 28, 2016
@cachedout

Copy link
Copy Markdown
Contributor

No apology necessary. Thanks, @fj40crawler !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants