Skip to content

Commit

Permalink
Do not import all ansible errors and fix the exception raised
Browse files Browse the repository at this point in the history
  • Loading branch information
mscherer committed Apr 14, 2015
1 parent 0345b67 commit 6957d66
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions v2/ansible/inventory/dir.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
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
Expand Down Expand Up @@ -160,7 +160,7 @@ def _merge_groups(self, group, newgroup):

# 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])
Expand Down Expand Up @@ -210,7 +210,7 @@ def _merge_hosts(self,host, newhost):

# 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:
Expand Down

0 comments on commit 6957d66

Please sign in to comment.