mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-02 14:40:19 -07:00
parent
2f33c1a1a1
commit
5553b20828
206 changed files with 1853 additions and 1870 deletions
|
@ -20,10 +20,11 @@ __metaclass__ = type
|
|||
from ansible.errors import AnsibleError
|
||||
from ansible.utils.vars import combine_vars
|
||||
|
||||
|
||||
class Group:
|
||||
''' a group of ansible hosts '''
|
||||
|
||||
#__slots__ = [ 'name', 'hosts', 'vars', 'child_groups', 'parent_groups', 'depth', '_hosts_cache' ]
|
||||
# __slots__ = [ 'name', 'hosts', 'vars', 'child_groups', 'parent_groups', 'depth', '_hosts_cache' ]
|
||||
|
||||
def __init__(self, name=None):
|
||||
|
||||
|
@ -87,7 +88,7 @@ class Group:
|
|||
self.child_groups.append(group)
|
||||
|
||||
# update the depth of the child
|
||||
group.depth = max([self.depth+1, group.depth])
|
||||
group.depth = max([self.depth + 1, group.depth])
|
||||
|
||||
# update the depth of the grandchildren
|
||||
group._check_children_depth()
|
||||
|
@ -105,7 +106,7 @@ class Group:
|
|||
|
||||
try:
|
||||
for group in self.child_groups:
|
||||
group.depth = max([self.depth+1, group.depth])
|
||||
group.depth = max([self.depth + 1, group.depth])
|
||||
group._check_children_depth()
|
||||
except RuntimeError:
|
||||
raise AnsibleError("The group named '%s' has a recursive dependency loop." % self.name)
|
||||
|
@ -180,6 +181,5 @@ class Group:
|
|||
try:
|
||||
self.priority = int(priority)
|
||||
except TypeError:
|
||||
#FIXME: warn about invalid priority
|
||||
# FIXME: warn about invalid priority
|
||||
pass
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue