Commit 6957d66a by Michael Scherer

Do not import all ansible errors and fix the exception raised

parent 0345b675
...@@ -23,7 +23,7 @@ __metaclass__ = type ...@@ -23,7 +23,7 @@ __metaclass__ = type
import os import os
from ansible import constants as C from ansible import constants as C
from ansible.errors import * from ansible.errors import AnsibleError
from ansible.inventory.host import Host from ansible.inventory.host import Host
from ansible.inventory.group import Group from ansible.inventory.group import Group
...@@ -160,7 +160,7 @@ class InventoryDirectory(object): ...@@ -160,7 +160,7 @@ class InventoryDirectory(object):
# name # name
if group.name != 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 # depth
group.depth = max([group.depth, newgroup.depth]) group.depth = max([group.depth, newgroup.depth])
...@@ -210,7 +210,7 @@ class InventoryDirectory(object): ...@@ -210,7 +210,7 @@ class InventoryDirectory(object):
# name # name
if host.name != 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 # group membership relation
for newgroup in newhost.groups: for newgroup in newhost.groups:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment