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

xfconf module state absent causes exception #63711

Closed
baztian opened this issue Oct 19, 2019 · 18 comments
Closed

xfconf module state absent causes exception #63711

baztian opened this issue Oct 19, 2019 · 18 comments
Labels
affects_2.10 This issue/PR affects Ansible v2.10 bot_closed bug This issue/PR relates to a bug. collection:community.general collection Related to Ansible Collections work module This issue/PR relates to a module. needs_collection_redirect https://github.com/ansible/ansibullbot/blob/master/docs/collection_migration.md python3 support:community This issue/PR relates to code supported by the Ansible community. system System category traceback This issue/PR includes a traceback.

Comments

@baztian
Copy link

baztian commented Oct 19, 2019

SUMMARY

Running xfconf module with state = absent causes an error:

AttributeError: 'NoneType' object has no attribute 'lower'
ISSUE TYPE
  • Bug Report
COMPONENT NAME

xfconf

ANSIBLE VERSION
ansible 2.8.5
  config file = /home/me/Sources/ansible-mint-setup/ansible.cfg
  configured module search path = ['/home/me/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/me/Software/ansible/lib/python3.5/site-packages/ansible
  executable location = /home/me/bin/ansible
  python version = 3.5.2 (default, Oct  8 2019, 13:06:37) [GCC 5.4.0 20160609]
CONFIGURATION
ANSIBLE_NOCOWS(/home/me/Sources/ansible-mint-setup/ansible.cfg) = True
OS / ENVIRONMENT

Linux mint

STEPS TO REPRODUCE
  - name: Remove stuff
    xfconf:
      channel: xfce4-keyboard-shortcuts
      property: "/xfwm4/custom/<Alt>space"
      state: absent
EXPECTED RESULTS

I'm expecting the property (/xfwm4/custom/<Alt>space) gets removed

ACTUAL RESULTS
TASK [baztian.xfce : Remove stuff] *********************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: AttributeError: 'NoneType' object has no attribute 'lower'
fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n  File \"/home/me/.ansible/tmp/ansible-tmp-1571599392.6388974-76577773196690/AnsiballZ_xfconf.py\", line 114, in <module>\n    _ansiballz_main()\n  File \"/home/me/.ansible/tmp/ansible-tmp-1571599392.6388974-76577773196690/AnsiballZ_xfconf.py\", line 106, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/home/me/.ansible/tmp/ansible-tmp-1571599392.6388974-76577773196690/AnsiballZ_xfconf.py\", line 49, in invoke_module\n    imp.load_module('__main__', mod, module, MOD_DESC)\n  File \"/tmp/ansible_xfconf_payload_ykcC_N/__main__.py\", line 215, in <module>\n  File \"/tmp/ansible_xfconf_payload_ykcC_N/__main__.py\", line 156, in main\nAttributeError: 'NoneType' object has no attribute 'lower'\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
WORKAROUND

Supply value and value_type although they are not used.

  - name: Remove stuff
    xfconf:
      channel: xfce4-keyboard-shortcuts
      value: dummy
      value_type: string
      property: "/xfwm4/custom/<Alt>space"
      state: absent
@ansibot
Copy link
Contributor

ansibot commented Oct 19, 2019

Files identified in the description:
None

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibot ansibot added affects_2.10 This issue/PR affects Ansible v2.10 bug This issue/PR relates to a bug. needs_triage Needs a first human triage before being processed. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Oct 19, 2019
@baztian
Copy link
Author

baztian commented Oct 19, 2019

Also xfconf always reports "changed" for my work around.

@Akasurde
Copy link
Member

!component =lib/ansible/modules/system/xfconf.py

@Akasurde
Copy link
Member

@baztian Could you please fill other details in the issue so that it will be easy to debug ? Thanks

needs_info

@ansibot
Copy link
Contributor

ansibot commented Oct 20, 2019

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibot
Copy link
Contributor

ansibot commented Oct 20, 2019

@ansibot ansibot added module This issue/PR relates to a module. needs_info This issue requires further information. Please answer any outstanding questions. support:community This issue/PR relates to code supported by the Ansible community. system System category and removed needs_triage Needs a first human triage before being processed. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Oct 20, 2019
@jbenden
Copy link
Contributor

jbenden commented Oct 20, 2019

cc @russoz

@baztian
Copy link
Author

baztian commented Oct 20, 2019

Sorry @Akasurde the issue text got somehow lost. I've now updated it.

@ansibot ansibot added traceback This issue/PR includes a traceback. and removed needs_info This issue requires further information. Please answer any outstanding questions. labels Oct 20, 2019
@russoz
Copy link
Contributor

russoz commented Oct 20, 2019

@baztian Thanks for reporting it. Bear in mind this module is about to get a major revamp in #62578
Cheers, Alex

@Akasurde
Copy link
Member

@baztian Could you please check PR #62578 and let us know if it works for you ? Thanks.

needs_info

@ansibot ansibot added the needs_info This issue requires further information. Please answer any outstanding questions. label Oct 21, 2019
@baztian
Copy link
Author

baztian commented Oct 21, 2019

@Akasurde, just tried the PR. This works. One thing to optimize though is that it always reports changed for already absent properties.

@ansibot ansibot removed the needs_info This issue requires further information. Please answer any outstanding questions. label Oct 21, 2019
@Akasurde
Copy link
Member

@russoz Could you please address above comment ? Thanks.

@russoz
Copy link
Contributor

russoz commented Oct 22, 2019

@Akasurde sure! Will add to #62578 (along with a couple of other fixes/improvements).

@russoz
Copy link
Contributor

russoz commented Oct 22, 2019

@baztian I have pushed the changes, would you please confirm the results?

@baztian
Copy link
Author

baztian commented Oct 22, 2019

Thanks @russoz . This seems to work. Without the dummy properties and no changes reported on consecutive runs. Good work! 👍

@russoz
Copy link
Contributor

russoz commented Oct 22, 2019

Yay, happy to know that! :-)

@russoz
Copy link
Contributor

russoz commented Oct 23, 2019

@Akasurde I suppose we're good to go. What's next now?

@ansibot ansibot added collection Related to Ansible Collections work collection:community.general needs_collection_redirect https://github.com/ansible/ansibullbot/blob/master/docs/collection_migration.md labels Apr 29, 2020
@ansibot
Copy link
Contributor

ansibot commented Aug 16, 2020

Thank you very much for your interest in Ansible. Ansible has migrated much of the content into separate repositories to allow for more rapid, independent development. We are closing this issue/PR because this content has been moved to one or more collection repositories.

For further information, please see:
https://github.com/ansible/ansibullbot/blob/master/docs/collection_migration.md

@ansibot ansibot closed this as completed Aug 16, 2020
@ansible ansible locked and limited conversation to collaborators Sep 13, 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 bot_closed bug This issue/PR relates to a bug. collection:community.general collection Related to Ansible Collections work module This issue/PR relates to a module. needs_collection_redirect https://github.com/ansible/ansibullbot/blob/master/docs/collection_migration.md python3 support:community This issue/PR relates to code supported by the Ansible community. system System category traceback This issue/PR includes a traceback.
Projects
None yet
Development

No branches or pull requests

5 participants