Dynamic inventory print dependency errors don't help

Bug #1420312 reported by git-harry
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack-Ansible
Fix Released
Low
git-harry
Icehouse
Won't Fix
Low
git-harry
Juno
Fix Released
Low
Jesse Pretorius
Trunk
Fix Released
Low
git-harry

Bug Description

When netaddr is not installed the import fails but nothing is printed. Not sure why it would be necessary anyway, just let the ImportError cause the script to exit.

# ansible-playbook -e/etc/rpc_deploy/user_variables.yml playbooks/openstack/cinder-api.yml -vvvv
ERROR: Inventory script (inventory/dynamic_inventory.py) had an execution error: Traceback (most recent call last):
  File "/root/os-ansible-deployment/rpc_deployment/inventory/dynamic_inventory.py", line 846, in <module>
    main()
  File "/root/os-ansible-deployment/rpc_deployment/inventory/dynamic_inventory.py", line 799, in main
    _set_used_ips(user_defined_config, dynamic_inventory)
  File "/root/os-ansible-deployment/rpc_deployment/inventory/dynamic_inventory.py", line 589, in _set_used_ips
    netaddr.iter_iprange(
NameError: global name 'netaddr' is not defined

git-harry (git-harry)
Changed in openstack-ansible:
assignee: nobody → git-harry (git-harry)
Changed in openstack-ansible:
importance: Undecided → Low
status: New → Triaged
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to os-ansible-deployment (master)

Reviewed: https://review.openstack.org/154498
Committed: https://git.openstack.org/cgit/stackforge/os-ansible-deployment/commit/?id=de32ddca574150806c4dbb9a47930b0b6d1196f0
Submitter: Jenkins
Branch: master

commit de32ddca574150806c4dbb9a47930b0b6d1196f0
Author: git-harry <email address hidden>
Date: Tue Feb 10 14:33:14 2015 +0000

    Remove ImportError handling in dynamic_inventory

    The import of netaddr any yaml is done within a try/except block. If an
    ImportError occurs an error message is printed and the script ignores
    it. Ansible does not display the printed message and the script will
    still fail, just later on.

    This commit removes the exception handling so that if there is an
    ImportError the script will fail straight away.

    Change-Id: Iff935db62bde954ac4ff0b920409c18dd494bdff
    Closes-Bug: #1420312

Changed in openstack-ansible:
status: Triaged → Fix Committed
tags: added: icehouse-backport-potential juno-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to os-ansible-deployment (juno)

Fix proposed to branch: juno
Review: https://review.openstack.org/156628

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to os-ansible-deployment (juno)

Reviewed: https://review.openstack.org/156628
Committed: https://git.openstack.org/cgit/stackforge/os-ansible-deployment/commit/?id=8513dd167e5100ace741900c1e191511ecf5954d
Submitter: Jenkins
Branch: juno

commit 8513dd167e5100ace741900c1e191511ecf5954d
Author: git-harry <email address hidden>
Date: Tue Feb 10 14:33:14 2015 +0000

    Remove ImportError handling in dynamic_inventory

    The import of netaddr any yaml is done within a try/except block. If an
    ImportError occurs an error message is printed and the script ignores
    it. Ansible does not display the printed message and the script will
    still fail, just later on.

    This commit removes the exception handling so that if there is an
    ImportError the script will fail straight away.

    Change-Id: Iff935db62bde954ac4ff0b920409c18dd494bdff
    Closes-Bug: #1420312
    (cherry picked from commit de32ddca574150806c4dbb9a47930b0b6d1196f0)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.