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

Invalid options for assert: success_msg #47030

Merged
merged 1 commit into from
Oct 24, 2018

Conversation

quater
Copy link
Contributor

@quater quater commented Oct 14, 2018

SUMMARY

With Ansible 2.7, the assert module was enhanced with the success message. See module documentation at https://docs.ansible.com/ansible/2.7/modules/assert_module.html. The below example task fails with the error: Invalid options for assert: success_msg

- name: after version 2.7 both 'msg' and 'fail_msg' can customize failing assertion message
  assert:
    that:
      - "my_param <= 100"
      - "my_param >= 0"
    fail_msg: "'my_param' must be between 0 and 100"
    success_msg: "'my_param' is between 0 and 100"
ISSUE TYPE
  • Bug Report
COMPONENT NAME

assert

ANSIBLE VERSION
ansible 2.7.0
STEPS TO REPRODUCE
- name: after version 2.7 both 'msg' and 'fail_msg' can customize failing assertion message
  assert:
    that:
      - "my_param <= 100"
      - "my_param >= 0"
    fail_msg: "'my_param' must be between 0 and 100"
    success_msg: "'my_param' is between 0 and 100"
EXPECTED RESULTS

It should accept the success_msg parameter

ACTUAL RESULTS
fatal: [hostname]: FAILED! => changed=false 
  msg: 'Invalid options for assert: success_msg'

@quater quater changed the base branch from devel to stable-2.7 October 14, 2018 19:49
@quater quater changed the title Ansible issue 47029 Invalid options for assert: success_msg Oct 14, 2018
@quater quater changed the base branch from stable-2.7 to devel October 14, 2018 19:56
@ansibot
Copy link
Contributor

ansibot commented Oct 14, 2018

Hi @quater, thank you for submitting this pull-request!

click here for bot help

@ansibot ansibot added affects_2.8 This issue/PR affects Ansible v2.8 bug This issue/PR relates to a bug. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. needs_triage Needs a first human triage before being processed. small_patch support:community This issue/PR relates to code supported by the Ansible community. labels Oct 14, 2018
@Akasurde
Copy link
Member

@quater Thanks for the pull request. Could you please use devel as base branch, as there are some merge conflicts which caused CI failures ? Once this is merged in devel we can create backport of this change to other branches such as Stable-2.7 and Stable-2.6 (as applicable).

@Akasurde
Copy link
Member

@Akasurde Akasurde removed the needs_triage Needs a first human triage before being processed. label Oct 15, 2018
@quater
Copy link
Contributor Author

quater commented Oct 15, 2018

@Akasurde Initially I had this PR pointing to the Stable-2.7 branch but I then changed it to the devel base branch within 20 minutes of having created this PR. It appears that this didn't trigger a new CI test run. Can you trigger a test manually please?

@Akasurde
Copy link
Member

@quater I see merge conflict errors in https://app.shippable.com/github/ansible/ansible/runs/88515/1/console, I think you need to create PR with devel as base branch rather than stable-2.7.

@mattclay mattclay added the ci_verified Changes made in this PR are causing tests to fail. label Oct 15, 2018
@ansibot ansibot removed the ci_verified Changes made in this PR are causing tests to fail. label Oct 17, 2018
@quater
Copy link
Contributor Author

quater commented Oct 17, 2018

@Akasurde I corrected it now. It should be good to go.

@ansibot ansibot removed the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. label Oct 17, 2018
@Akasurde
Copy link
Member

LGTM, need another pair of eye to take a look.

@ansibot ansibot added community_review In order to be merged, this PR must follow the community review workflow. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed community_review In order to be merged, this PR must follow the community review workflow. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Oct 24, 2018
@mkrizek mkrizek merged commit 0661f2f into ansible:devel Oct 24, 2018
mkrizek pushed a commit to mkrizek/ansible that referenced this pull request Oct 24, 2018
abadger pushed a commit that referenced this pull request Oct 25, 2018
)

* adds 'success_msg' to valid args for assert module (#47030)


(cherry picked from commit 0661f2f)

* Add changelog
Tomorrow9 pushed a commit to Tomorrow9/ansible that referenced this pull request Dec 4, 2018
@ansible ansible locked and limited conversation to collaborators Jul 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.8 This issue/PR affects Ansible v2.8 bug This issue/PR relates to a bug. community_review In order to be merged, this PR must follow the community review workflow. small_patch support:community This issue/PR relates to code supported by the Ansible community.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants