From 6957d66a2630ea6eb624372234c93e44b1977d98 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Tue, 14 Apr 2015 15:43:02 -0400 Subject: [PATCH] Do not import all ansible errors and fix the exception raised --- v2/ansible/inventory/dir.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/v2/ansible/inventory/dir.py b/v2/ansible/inventory/dir.py index 73c882f288f..735f32d62c3 100644 --- a/v2/ansible/inventory/dir.py +++ b/v2/ansible/inventory/dir.py @@ -23,7 +23,7 @@ __metaclass__ = type import os from ansible import constants as C -from ansible.errors import * +from ansible.errors import AnsibleError from ansible.inventory.host import Host from ansible.inventory.group import Group @@ -160,7 +160,7 @@ class InventoryDirectory(object): # name if group.name != newgroup.name: - raise errors.AnsibleError("Cannot merge group %s with %s" % (group.name, newgroup.name)) + raise AnsibleError("Cannot merge group %s with %s" % (group.name, newgroup.name)) # depth group.depth = max([group.depth, newgroup.depth]) @@ -210,7 +210,7 @@ class InventoryDirectory(object): # name if host.name != newhost.name: - raise errors.AnsibleError("Cannot merge host %s with %s" % (host.name, newhost.name)) + raise AnsibleError("Cannot merge host %s with %s" % (host.name, newhost.name)) # group membership relation for newgroup in newhost.groups: