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

Don't throw exception when variable is undefined #2

Open
famedly-bot opened this issue Dec 14, 2022 · 0 comments
Open

Don't throw exception when variable is undefined #2

famedly-bot opened this issue Dec 14, 2022 · 0 comments
Labels
priority::5-medium progress::backlog The Refinement of the issue is completed and DoR for the Squad is fulfilled team:infrastructure

Comments

@famedly-bot
Copy link

In GitLab by @jcgruenhage on Dec 14, 2022, 13:02

I've tried rolling out with a variable undefined, which meant that a DNS records had no address. I could't figure out what the concrete problem was until later, because the module just completely refused operation with a less than helpful stacktrace:

The full traceback is:
Traceback (most recent call last):
  File "/home/jcgruenhage/.ansible/tmp/ansible-tmp-1671018808.3882365-10237-223587720065386/AnsiballZ_update.py", line 107, in <module>
    _ansiballz_main()
  File "/home/jcgruenhage/.ansible/tmp/ansible-tmp-1671018808.3882365-10237-223587720065386/AnsiballZ_update.py", line 99, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/home/jcgruenhage/.ansible/tmp/ansible-tmp-1671018808.3882365-10237-223587720065386/AnsiballZ_update.py", line 47, in invoke_module
    runpy.run_module(mod_name='ansible_collections.famedly.dns.plugins.modules.update', init_globals=dict(_module_fqn='ansible_collections.famedly.dns.plugins.modules.update', _modlib_path=modlib_path),
  File "<frozen runpy>", line 226, in run_module
  File "<frozen runpy>", line 98, in _run_module_code
  File "<frozen runpy>", line 88, in _run_code
  File "/tmp/ansible_famedly.dns.update_payload_qu9uu6zd/ansible_famedly.dns.update_payload.zip/ansible_collections/famedly/dns/plugins/modules/update.py", line 180, in <module>
  File "/tmp/ansible_famedly.dns.update_payload_qu9uu6zd/ansible_famedly.dns.update_payload.zip/ansible_collections/famedly/dns/plugins/modules/update.py", line 152, in main
  File "/tmp/ansible_famedly.dns.update_payload_qu9uu6zd/ansible_famedly.dns.update_payload.zip/ansible_collections/famedly/dns/plugins/module_utils/dnsupdate_utils.py", line 67, in send_dns_update_message
  File "/usr/lib/python3.11/site-packages/dns/update.py", line 168, in add
    self._add(False, self.update, name, *args)
  File "/usr/lib/python3.11/site-packages/dns/update.py", line 151, in _add
    rd = dns.rdata.from_text(self.zone_rdclass, rdtype, s,
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/dns/rdata.py", line 613, in from_text
    rdata = cls.from_text(rdclass, rdtype, tok, origin, relativize,
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/dns/rdtypes/IN/AAAA.py", line 42, in from_text
    address = tok.get_identifier()
              ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/dns/tokenizer.py", line 581, in get_identifier
    raise dns.exception.SyntaxError('expecting an identifier')
dns.exception.SyntaxError: expecting an identifier
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority::5-medium progress::backlog The Refinement of the issue is completed and DoR for the Squad is fulfilled team:infrastructure
Projects
None yet
Development

No branches or pull requests

1 participant