Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

AttributeError: 'NoneType' object has no attribute 'text' #18

Closed
jilgue opened this issue Apr 2, 2019 · 4 comments
Closed

AttributeError: 'NoneType' object has no attribute 'text' #18

jilgue opened this issue Apr 2, 2019 · 4 comments

Comments

@jilgue
Copy link

jilgue commented Apr 2, 2019

Hello,

I've been trying the module with a empty pfsense installation:

And when I run the playbook, I get the following error:

---
- hosts: pfsense

  tasks:
    - name: Add adservers alias
      pfsense_alias:
        name: adservers
        address: 10.0.0.1 10.0.0.2
        state: present
        type: host
The full traceback is:
Traceback (most recent call last):
  File "<stdin>", line 113, in <module>
  File "<stdin>", line 105, in _ansiballz_main
  File "<stdin>", line 48, in invoke_module
  File "/tmp/ansible_pfsense_alias_payload_A_n1LQ/__main__.py", line 93, in <module>
  File "/tmp/ansible_pfsense_alias_payload_A_n1LQ/__main__.py", line 88, in main
  File "/tmp/ansible_pfsense_alias_payload_A_n1LQ/ansible_pfsense_alias_payload.zip/ansible/module_utils/networking/pfsense/pfsense_alias.py", line 188, in run
  File "/tmp/ansible_pfsense_alias_payload_A_n1LQ/ansible_pfsense_alias_payload.zip/ansible/module_utils/networking/pfsense/pfsense_alias.py", line 161, in _params_to_alias
  File "/tmp/ansible_pfsense_alias_payload_A_n1LQ/ansible_pfsense_alias_payload.zip/ansible/module_utils/networking/pfsense/pfsense_alias.py", line 134, in _validate_params
  File "/tmp/ansible_pfsense_alias_payload_A_n1LQ/ansible_pfsense_alias_payload.zip/ansible/module_utils/networking/pfsense/pfsense.py", line 67, in get_interface_pfsense_by_name
AttributeError: 'NoneType' object has no attribute 'text'

If you navigate to /interfaces.php?if=wan, you save without changes and you apply, the error disappear.

f-bor added a commit that referenced this issue Apr 2, 2019
@f-bor
Copy link
Collaborator

f-bor commented Apr 2, 2019

Hi,

It should be fixed by the last commits.

@jilgue
Copy link
Author

jilgue commented Apr 3, 2019

It works !

Thanks :)

@jilgue jilgue closed this as completed Apr 3, 2019
@jilgue
Copy link
Author

jilgue commented Apr 3, 2019

Hi,

Sorry, but the error still appears.
This time when you remove a firewall rule:

    - name: "Add Internal DNS out rule"
      pfsense_rule:
        name: 'Allow Internal DNS traffic out'
        action: pass
        interface: lan
        ipprotocol: inet
        protocol: udp
        source: adservers
        destination: any:53
        state: present
The full traceback is:
Traceback (most recent call last):
  File "<stdin>", line 113, in <module>
  File "<stdin>", line 105, in _ansiballz_main
  File "<stdin>", line 48, in invoke_module
  File "/tmp/ansible_pfsense_rule_payload_D003BW/__main__.py", line 122, in <module>
  File "/tmp/ansible_pfsense_rule_payload_D003BW/__main__.py", line 117, in main
  File "/tmp/ansible_pfsense_rule_payload_D003BW/ansible_pfsense_rule_payload.zip/ansible/module_utils/networking/pfsense/pfsense_rule.py", line 607, in run
  File "/tmp/ansible_pfsense_rule_payload_D003BW/ansible_pfsense_rule_payload.zip/ansible/module_utils/networking/pfsense/pfsense_rule.py", line 535, in _remove
  File "/tmp/ansible_pfsense_rule_payload_D003BW/ansible_pfsense_rule_payload.zip/ansible/module_utils/networking/pfsense/pfsense_rule.py", line 283, in _log_delete
  File "/tmp/ansible_pfsense_rule_payload_D003BW/ansible_pfsense_rule_payload.zip/ansible/module_utils/networking/pfsense/pfsense.py", line 82, in get_interface_display_name
AttributeError: 'NoneType' object has no attribute 'text'

@jilgue jilgue reopened this Apr 3, 2019
f-bor added a commit that referenced this issue Apr 4, 2019
@f-bor
Copy link
Collaborator

f-bor commented Apr 4, 2019

sorry, I have been lazy on the first fix. It is fixed in all cases now.

@f-bor f-bor closed this as completed Apr 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants