Bug 1336909 - [abrt] ansible-lint: utils.py:81:find_children:AttributeError: 'module' object has no attribute 'parse_yaml_from_file'
Summary: [abrt] ansible-lint: utils.py:81:find_children:AttributeError: 'module' objec...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: ansible-lint
Version: 22
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Parag Nemade
QA Contact: Fedora Extras Quality Assurance
URL: https://retrace.fedoraproject.org/faf...
Whiteboard: abrt_hash:88a2019120fd7c03c1586ac386b...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-05-17 19:25 UTC by Till Maas
Modified: 2016-06-21 21:49 UTC (History)
3 users (show)

Fixed In Version: ansible-lint-2.6.2-1.fc22 ansible-lint-2.6.2-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-06-07 01:20:48 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
File: backtrace (747 bytes, text/plain)
2016-05-17 19:25 UTC, Till Maas
no flags Details

Description Till Maas 2016-05-17 19:25:39 UTC
Description of problem:
I ran ansible-lint on a playbook.

Version-Release number of selected component:
ansible-lint-2.0.3-1.fc22

Additional info:
reporter:       libreport-2.6.4
cmdline:        /usr/bin/python2 /usr/bin/ansible-lint playbook.yml
environ:        
executable:     /usr/bin/ansible-lint
kernel:         4.4.6-201.fc22.x86_64
runlevel:       N 5
type:           Python
uid:            1000

Truncated backtrace:
utils.py:81:find_children:AttributeError: 'module' object has no attribute 'parse_yaml_from_file'

Traceback (most recent call last):
  File "/usr/bin/ansible-lint", line 104, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/usr/bin/ansible-lint", line 91, in main
    matches = runner.run()
  File "/usr/lib/python2.7/site-packages/ansiblelint/__init__.py", line 171, in run
    for file in utils.find_children(arg):
  File "/usr/lib/python2.7/site-packages/ansiblelint/utils.py", line 81, in find_children
    pb_data = ansible.utils.parse_yaml_from_file(playbook[0])
AttributeError: 'module' object has no attribute 'parse_yaml_from_file'

Local variables in innermost frame:
basedir: ''
results: []
playbook: ('playbook.yml', 'playbook')

Comment 1 Till Maas 2016-05-17 19:25:43 UTC
Created attachment 1158461 [details]
File: backtrace

Comment 2 Parag Nemade 2016-05-18 04:41:15 UTC
I ran ansible-lint on couple of playbook files and they worked fine. I think to  reproduce this bug, I will need that exact playbook file. 

Or we have latest ansible-lint-2.6.2 built for F23+ releases. I have done a scratch build for f22. You can check your playbook against this new ansible-lint release -> http://koji.fedoraproject.org/koji/taskinfo?taskID=14142583

Comment 3 Till Maas 2016-05-20 22:12:28 UTC
Thank you for the fast reply.

The bug also happens with playbooks from Fedora infra, for example:
ansible-lint playbooks/rdiff-backup.yml
Traceback (most recent call last):
  File "/usr/bin/ansible-lint", line 104, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/usr/bin/ansible-lint", line 91, in main
    matches = runner.run()
  File "/usr/lib/python2.7/site-packages/ansiblelint/__init__.py", line 171, in run
    for file in utils.find_children(arg):
  File "/usr/lib/python2.7/site-packages/ansiblelint/utils.py", line 81, in find_children
    pb_data = ansible.utils.parse_yaml_from_file(playbook[0])
AttributeError: 'module' object has no attribute 'parse_yaml_from_file'

And there is no parse_yaml_from_file in ansible.utils from ansible-2.0.2.0-1.fc22

It works with ansible-lint-2.6.2-1.fc22.noarch from the scratch build.

Comment 4 Orion Poplawski 2016-05-20 22:42:27 UTC
I'm seeing with on EPEL7 which has a woefully out of date ansible-lint as well:

ansible-lint-2.0.1-1.el7.noarch

Comment 5 Orion Poplawski 2016-05-20 23:01:39 UTC
Fails to build on el7 with:

Executing(%check): /bin/sh -e /tmp/rpm/rpm-tmp.vHovss
+ umask 022
+ cd /export/home/orion/fedora/ansible-lint
+ cd ansible-lint-2.6.2
+ /usr/bin/python2 setup.py test
/usr/lib64/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'include_package_date'
  warnings.warn(msg)
running test
running egg_info
writing requirements to lib/ansible_lint.egg-info/requires.txt
writing lib/ansible_lint.egg-info/PKG-INFO
writing top-level names to lib/ansible_lint.egg-info/top_level.txt
writing dependency_links to lib/ansible_lint.egg-info/dependency_links.txt
reading manifest file 'lib/ansible_lint.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'lib/ansible_lint.egg-info/SOURCES.txt'
running build_ext
Traceback (most recent call last):
  File "setup.py", line 26, in <module>
    test_suite="test"
  File "/usr/lib64/python2.7/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/usr/lib64/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/lib64/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/usr/lib/python2.7/site-packages/setuptools/command/test.py", line 138, in run
    self.with_project_on_sys_path(self.run_tests)
  File "/usr/lib/python2.7/site-packages/setuptools/command/test.py", line 118, in with_project_on_sys_path
    func()
  File "/usr/lib/python2.7/site-packages/setuptools/command/test.py", line 164, in run_tests
    testLoader = cks
  File "/usr/lib64/python2.7/unittest/main.py", line 94, in __init__
    self.parseArgs(argv)
  File "/usr/lib64/python2.7/unittest/main.py", line 149, in parseArgs
    self.createTests()
  File "/usr/lib64/python2.7/unittest/main.py", line 158, in createTests
    self.module)
  File "/usr/lib64/python2.7/unittest/loader.py", line 128, in loadTestsFromNames
    suites = [self.loadTestsFromName(name, module) for name in names]
  File "/usr/lib64/python2.7/unittest/loader.py", line 103, in loadTestsFromName
    return self.loadTestsFromModule(obj)
  File "/usr/lib/python2.7/site-packages/setuptools/command/test.py", line 35, in loadTestsFromModule
    tests.append(self.loadTestsFromName(submodule))
  File "/usr/lib64/python2.7/unittest/loader.py", line 100, in loadTestsFromName
    parent, obj = obj, getattr(obj, part)
AttributeError: 'module' object has no attribute 'test_support'


But I think this is because there aren't actually any tests to run.

Comment 6 Parag Nemade 2016-05-21 04:20:54 UTC
Thanks Till and Orion. I will backport the 2.6.2 release to F22 and epel7.

Comment 7 Fedora Update System 2016-05-21 05:21:42 UTC
ansible-lint-2.6.2-1.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2016-6919765188

Comment 8 Fedora Update System 2016-05-21 09:53:21 UTC
ansible-lint-2.6.2-1.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-3e196c6cc5

Comment 9 Fedora Update System 2016-05-22 03:50:58 UTC
ansible-lint-2.6.2-1.fc22 has been pushed to the Fedora 22 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-6919765188

Comment 10 Fedora Update System 2016-05-23 15:19:41 UTC
ansible-lint-2.6.2-1.el7 has been pushed to the Fedora EPEL 7 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-EPEL-2016-3e196c6cc5

Comment 11 Fedora Update System 2016-06-07 01:20:46 UTC
ansible-lint-2.6.2-1.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.

Comment 12 Fedora Update System 2016-06-21 21:49:57 UTC
ansible-lint-2.6.2-1.el7 has been pushed to the Fedora EPEL 7 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.