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
This commit is contained in:
git-harry 2015-02-10 14:33:14 +00:00
parent ca3a0b2e39
commit de32ddca57

View File

@ -19,21 +19,14 @@ import argparse
import datetime
import hashlib
import json
import netaddr
import os
import Queue
import random
import tarfile
import uuid
import yaml
try:
import yaml
except ImportError:
print('Missing Dependency, "PyYAML"')
try:
import netaddr
except ImportError:
print('Missing Dependency, "netaddr"')
USED_IPS = []
INVENTORY_SKEL = {