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

syspatch: Check for apply=no condition #65350

Merged
merged 1 commit into from Nov 30, 2019
Merged

Conversation

Akasurde
Copy link
Member

SUMMARY

Signed-off-by: Abhijeet Kasurde akasurde@redhat.com

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

lib/ansible/modules/system/syspatch.py

@ansibot
Copy link
Contributor

ansibot commented Nov 28, 2019

@ansibot ansibot added affects_2.10 This issue/PR affects Ansible v2.10 bug This issue/PR relates to a bug. community_review In order to be merged, this PR must follow the community review workflow. has_issue module This issue/PR relates to a module. 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. system System category labels Nov 28, 2019
@ansibot
Copy link
Contributor

ansibot commented Nov 28, 2019

The test ansible-test sanity --test pep8 [explain] failed with 1 error:

lib/ansible/modules/system/syspatch.py:129:5: E303: too many blank lines (2)

click here for bot help

@ansibot ansibot added ci_verified Changes made in this PR are causing tests to fail. 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. labels Nov 28, 2019
@solvaholic
Copy link
Contributor

Thank you @Akasurde , this does resolve the issue in #65216

A different issue is apparent now, though. On the remote host I reverted one patch:

my-host# syspatch -r
Reverting patch 008_mesa
my-host# syspatch -c
008_mesa

Then when I ran -m syspatch with apply=no, it applied the patch and didn't tell me:

my-host.example.com | CHANGED => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/local/bin/python3.7"
    },
    "changed": true,
    "rc": 0,
    "reboot_needed": false,
    "stderr": "",
    "stderr_lines": [],
    "stdout": "",
    "stdout_lines": []
}

I reverted the patch on the remote host again. Then when I ran -m syspatch with apply=yes, it applied the patch and did tell me:

my-host.example.com | CHANGED => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/local/bin/python3.7"
    },
    "changed": true,
    "rc": 0,
    "reboot_needed": false,
    "stderr": "",
    "stderr_lines": [],
    "stdout": "Installing patch 008_mesa\nErrata can be reviewed under /var/syspatch\n",
    "stdout_lines": [
        "Installing patch 008_mesa",
        "Errata can be reviewed under /var/syspatch"
    ]
}

I'll suggest a way to resolve this, tho I'm unfamiliar with how @precurse intends it to work.

@ansibot ansibot added community_review In order to be merged, this PR must follow the community review workflow. and removed ci_verified Changes made in this PR are causing tests to fail. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Nov 29, 2019
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Copy link
Contributor

@solvaholic solvaholic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for taking care of this @Akasurde

These each succeeded as expected with OpenBSD 6.6 and Python 3.7 at this PR's HEAD commit:

  • apply=no
  • apply=yes
  • revert=one
  • revert=all

@Akasurde Akasurde merged commit 0d34a2e into ansible:devel Nov 30, 2019
@Akasurde Akasurde deleted the syspatch_fix branch November 30, 2019 14:09
@sivel sivel removed the needs_triage Needs a first human triage before being processed. label Dec 2, 2019
D3DeFi pushed a commit to D3DeFi/ansible that referenced this pull request Dec 8, 2019
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
anshulbehl pushed a commit to anshulbehl/ansible that referenced this pull request Dec 10, 2019
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
@ansible ansible locked and limited conversation to collaborators Jan 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.10 This issue/PR affects Ansible v2.10 bug This issue/PR relates to a bug. community_review In order to be merged, this PR must follow the community review workflow. has_issue module This issue/PR relates to a module. small_patch support:community This issue/PR relates to code supported by the Ansible community. system System category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants