Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1381538 - NameError: global name 'AnsibleError' is not defined
Summary: NameError: global name 'AnsibleError' is not defined
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: ansible
Version: 25
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Kevin Fenzi
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-10-04 12:04 UTC by F.J. Simon
Modified: 2016-11-19 21:12 UTC (History)
8 users (show)

Fixed In Version: ansible-2.2.0.0-3.fc24 ansible-2.2.0.0-3.fc25
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-07 23:27:52 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github 17895 0 None None None 2016-10-04 12:04:48 UTC

Description F.J. Simon 2016-10-04 12:04:48 UTC
Description of problem:

typo in playbook resulted in unhandled exception

Version-Release number of selected component (if applicable):

ansible 2.1.2.0

How reproducible:

# site.yml
---

- hosts: all
  tasks:
    - include: test.yml

# test.yml
---
hosts: all

please note the missing "-" before hosts

cmd from dir where the files are located:
ansible-playbook site.yml

Actual results:

ansible-playbook site.yml -vvvv
Using /home/user/a-bug-project/ansible.cfg as config file
 [WARNING]: provided hosts list is empty, only localhost is available

ERROR! Unexpected Exception: global name 'AnsibleError' is not defined
the full traceback was:

Traceback (most recent call last):
  File "/usr/bin/ansible-playbook", line 92, in <module>
    exit_code = cli.run()
  File "/usr/lib/python2.7/site-packages/ansible/cli/playbook.py", line 154, in run
    results = pbex.run()
  File "/usr/lib/python2.7/site-packages/ansible/executor/playbook_executor.py", line 73, in run
    pb = Playbook.load(playbook_path, variable_manager=self._variable_manager, loader=self._loader)
  File "/usr/lib/python2.7/site-packages/ansible/playbook/__init__.py", line 53, in load
    pb._load_playbook_data(file_name=file_name, variable_manager=variable_manager)
  File "/usr/lib/python2.7/site-packages/ansible/playbook/__init__.py", line 98, in _load_playbook_data
    entry_obj = Play.load(entry, variable_manager=variable_manager, loader=self._loader)
  File "/usr/lib/python2.7/site-packages/ansible/playbook/play.py", line 115, in load
    return p.load_data(data, variable_manager=variable_manager, loader=loader)
  File "/usr/lib/python2.7/site-packages/ansible/playbook/base.py", line 219, in load_data
    self._attributes[name] = method(name, ds[name])
  File "/usr/lib/python2.7/site-packages/ansible/playbook/play.py", line 145, in _load_tasks
    return load_list_of_blocks(ds=ds, play=self, variable_manager=self._variable_manager, loader=self._loader)
  File "/usr/lib/python2.7/site-packages/ansible/playbook/helpers.py", line 58, in load_list_of_blocks
    loader=loader
  File "/usr/lib/python2.7/site-packages/ansible/playbook/block.py", line 79, in load
    return b.load_data(data, variable_manager=variable_manager, loader=loader)
  File "/usr/lib/python2.7/site-packages/ansible/playbook/base.py", line 219, in load_data
    self._attributes[name] = method(name, ds[name])
  File "/usr/lib/python2.7/site-packages/ansible/playbook/block.py", line 115, in _load_block
    use_handlers=self._use_handlers,
  File "/usr/lib/python2.7/site-packages/ansible/playbook/helpers.py", line 181, in load_list_of_tasks
    raise AnsibleError("included task files must contain a list of tasks", obj=data)
NameError: global name 'AnsibleError' is not defined

Expected results:

error handling

Additional info:

none

Comment 1 Kevin Fenzi 2016-10-04 15:50:15 UTC
You have a external github link added, but it doesn't seem to load. Can you share the upstream issue on this again please?

I'm not sure we want to carry any patches to this, but letting upstream know and fix it will get us the fix too, so thanks for filing. :)

Comment 2 F.J. Simon 2016-10-04 16:11:05 UTC
@Kevin Fenzi - the link requested :

https://github.com/ansible/ansible/issues/17895

As far as fix is concerned upstream is working hard :)

Comment 3 Fedora Update System 2016-11-02 17:30:55 UTC
ansible-2.2.0.0-2.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-e348c4e0e3

Comment 4 Fedora Update System 2016-11-02 17:31:40 UTC
ansible-2.2.0.0-2.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2016-a5f9956e38

Comment 5 Fedora Update System 2016-11-05 03:33:13 UTC
ansible-2.2.0.0-2.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-e348c4e0e3

Comment 6 Fedora Update System 2016-11-05 16:01:31 UTC
ansible-2.2.0.0-3.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-3113e71193

Comment 7 Fedora Update System 2016-11-05 16:02:10 UTC
ansible-2.2.0.0-3.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2016-3ccb098630

Comment 8 Fedora Update System 2016-11-05 19:01:25 UTC
ansible-2.2.0.0-3.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-3ccb098630

Comment 9 Fedora Update System 2016-11-06 01:53:31 UTC
ansible-2.2.0.0-3.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-3113e71193

Comment 10 Fedora Update System 2016-11-07 23:27:52 UTC
ansible-2.2.0.0-3.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.

Comment 11 Fedora Update System 2016-11-19 21:12:26 UTC
ansible-2.2.0.0-3.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.