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

Fix referenced before assignment in sysvinit module #42695

Merged
merged 2 commits into from Aug 15, 2018

Conversation

MichaelMayorov
Copy link
Contributor

SUMMARY

Using pattern keyword in service module leads to UnboundLocalError, e.g.

- name: Start redundant-router
  service: enabled=yes state=started name=redundant-router pattern=redundant-router

Here is ansible-playbook output for this error

fatal: [10-0-16-3.ams.flops.ru]: FAILED! => {
    "changed": false,
    "module_stderr": "Shared connection to 10-0-16-3.ams.flops.ru closed.\r\n",
    "module_stdout": "Traceback (most recent call last):\r\n  File \"/tmp/ansible_CSMBg8/ansible_module_sysvinit.py\", line 351, in <module>\r\n    main()\r\n  File \"/tmp/ansible_CSMBg8/ansible_module_sysvinit.py\", line 232, in main\r\n    if not worked:\r\nUnboundLocalError: local variable 'worked' referenced before assignment\r\n",
    "msg": "MODULE FAILURE",
    "rc": 1
}
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

lib/ansible/modules/system/sysvinit.py

ANSIBLE VERSION
2.6.1
ADDITIONAL INFORMATION

@ansibot ansibot added affects_2.7 This issue/PR affects Ansible v2.7 bug This issue/PR relates to a bug. core_review In order to be merged, this PR must follow the core review workflow. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. new_contributor This PR is the first contribution by a new community member. small_patch support:core This issue/PR relates to code supported by the Ansible Engineering Team. traceback This issue/PR includes a traceback. labels Jul 12, 2018
@bcoca bcoca removed the needs_triage Needs a first human triage before being processed. label Jul 12, 2018
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Jul 20, 2018
@pilou-
Copy link
Contributor

pilou- commented Aug 3, 2018

shipit

@pilou-
Copy link
Contributor

pilou- commented Aug 3, 2018

@bcoca review message needs to contains LGTM or shipit, otherwise ansibot ignores the review when counting the approvals.

@ansibot ansibot removed the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Aug 6, 2018
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Aug 14, 2018
@bcoca bcoca merged commit 7538a63 into ansible:devel Aug 15, 2018
@robinmulder
Copy link

This also affects 2.6.3, please backport to 2.6.

@resmo
Copy link
Contributor

resmo commented Sep 21, 2018

created a backport #45988

@resmo
Copy link
Contributor

resmo commented Sep 21, 2018

backport #45204

@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.7 This issue/PR affects Ansible v2.7 bug This issue/PR relates to a bug. core_review In order to be merged, this PR must follow the core review workflow. module This issue/PR relates to a module. new_contributor This PR is the first contribution by a new community member. small_patch stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. support:core This issue/PR relates to code supported by the Ansible Engineering Team. traceback This issue/PR includes a traceback.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants