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

Openstack Inventory Plugin "'NoneType' object has no attribute 'set'" #45431

Closed
mitchellmaler opened this issue Sep 10, 2018 · 8 comments · Fixed by #45759
Closed

Openstack Inventory Plugin "'NoneType' object has no attribute 'set'" #45431

mitchellmaler opened this issue Sep 10, 2018 · 8 comments · Fixed by #45759
Labels
affects_2.6 This issue/PR affects Ansible v2.6 bug This issue/PR relates to a bug. cloud inventory Inventory category openstack python3 support:community This issue/PR relates to code supported by the Ansible community.

Comments

@mitchellmaler
Copy link

SUMMARY

Trying to use the OpenStack Inventory plugin and I am getting the error
'NoneType' object has no attribute 'set'

ISSUE TYPE
  • Bug Report
COMPONENT NAME

Inventory Plugin

ANSIBLE VERSION
ansible 2.6.4
  config file = /Users/user/projects/projectname/ansible.cfg
  configured module search path = ['/Users/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']  ansible python module location = /usr/local/lib/python3.6/site-packages/ansible
  executable location = /usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/bin/ansible  python version = 3.6.5 (default, Jun 17 2018, 12:13:06) [GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.2)]
CONFIGURATION
DEFAULT_VAULT_PASSWORD_FILE(/Users/user/projects/projectname/ansible.cfg) = /Users/user/projects/projectname/.vault-password
INVENTORY_ENABLED(/Users/user/projects/projectname/ansible.cfg) = ['openstack', 'yaml']
OS / ENVIRONMENT

MacOS

STEPS TO REPRODUCE
ansible-playbook playbook.yml -i openstack-inventory.yaml
EXPECTED RESULTS

It gets the inventory from OpenStack.

ACTUAL RESULTS
[WARNING]:  * openstack-inventory.yaml with openstack plugin: 'NoneType' object has no attribute 'set'

@ansibot
Copy link
Contributor

ansibot commented Sep 10, 2018

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 ansibot added affects_2.6 This issue/PR affects Ansible v2.6 bug This issue/PR relates to a bug. needs_triage Needs a first human triage before being processed. python3 support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Sep 10, 2018
@bcoca bcoca removed the needs_triage Needs a first human triage before being processed. label Sep 10, 2018
@bcoca
Copy link
Member

bcoca commented Sep 10, 2018

cc @omgjlk @mavimo

@jakegatsby
Copy link
Contributor

I believe this was introduced in e89e4c99

Specifically, the openstack inventory plugin tries to self.cache.set when self.cache is None. I don't have a lot of experience here, but I'm experiencing this bug, and guessing it's caused when the user doesn't have caching enabled?

Anyway, just thought I would add this info.

@ansibot ansibot added inventory Inventory category support:community This issue/PR relates to code supported by the Ansible community. and removed support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Sep 15, 2018
@mitchellmaler
Copy link
Author

I was able to fix the issue which is still present in 2.7rc2 by adding a none type check on the line https://github.com/ansible/ansible/blob/devel/lib/ansible/plugins/inventory/openstack.py#L199

@bcoca
Copy link
Member

bcoca commented Sep 17, 2018

@mitchellmaler @jakegatsby can you confirm my PR above fixes the issue for you?

@mitchellmaler
Copy link
Author

mitchellmaler commented Sep 17, 2018

@bcoca that is the exact fix that I added and it does fix it!

bcoca added a commit that referenced this issue Sep 21, 2018
dincho added a commit to aeternity/infrastructure that referenced this issue Sep 25, 2018
- Ansible 2.6.4 introduces openstack inventory cache related issue, see
ansible/ansible#45431 for details
dincho added a commit to aeternity/infrastructure that referenced this issue Sep 26, 2018
- Ansible 2.6.4 introduces openstack inventory cache related issue, see
ansible/ansible#45431 for details
@jgeorgeson
Copy link

So looks like this wasn't included in 2.7.0, or in the recent 2.6.6 patch release? Any eta on when the fix will be released?

@jgeorgeson
Copy link

Fix not included in 2.7.1 patch either ...

Akasurde pushed a commit to Akasurde/ansible that referenced this issue Dec 19, 2018
Akasurde pushed a commit to Akasurde/ansible that referenced this issue Dec 19, 2018
abadger pushed a commit that referenced this issue Jan 7, 2019
mattclay pushed a commit that referenced this issue Jan 10, 2019
odyssey4me pushed a commit to odyssey4me/rpc-gating that referenced this issue Jan 15, 2019
The openstack plugin has a bug [1] which requires it to
have a cache configured. This bug has been fixed, but it
is not yet released.

We therefore configure a fact cache to work around the
issue.

[1] ansible/ansible#45431
[2] ansible/ansible@8490588

JIRA: RE-1721
odyssey4me pushed a commit to odyssey4me/rpc-gating that referenced this issue Jan 15, 2019
The openstack plugin has a bug [1] which requires it to
have a cache configured. This bug has been fixed, but it
is not yet released.

We therefore configure a fact cache to work around the
issue.

[1] ansible/ansible#45431
[2] ansible/ansible@8490588

JIRA: RE-1721
odyssey4me pushed a commit to odyssey4me/rpc-gating that referenced this issue Jan 15, 2019
The openstack plugin has a bug [1] which requires it to
have a cache configured. This bug has been fixed, but it
is not yet released.

We therefore configure a fact cache to work around the
issue.

[1] ansible/ansible#45431
[2] ansible/ansible@8490588

JIRA: RE-1721
@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.6 This issue/PR affects Ansible v2.6 bug This issue/PR relates to a bug. cloud inventory Inventory category openstack python3 support:community This issue/PR relates to code supported by the Ansible community.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants