Skip to content

Commit

Permalink
fix style issues
Browse files Browse the repository at this point in the history
  • Loading branch information
cmeissner committed Nov 13, 2020
1 parent e752a4b commit e0efd95
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions plugins/filter/phpipam.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@


class FilterModule(object):

"""Define useful filter in collection."""

def filters(self):
Expand All @@ -19,25 +20,26 @@ def filters(self):
:rtype: dict
"""
return {
'is_subnet': self.is_subnet,
'is_subnet': is_subnet,
}

def is_subnet(self, children, parent):
"""Check if a subnet belongs to another.

First argument is a subnet second another. If the first subnet belongs to second
def is_subnet(children, parent):
"""Check if a subnet belongs to another.
:param children: [description]
:type children: [type]
:param parent: [description]
:type parent: [type]
:return: [description]
:rtype: [type]
"""
c = ipaddress.ip_network(children)
p = ipaddress.ip_network(parent)
First argument is a subnet second another. If the first subnet belongs to second
:param children: [description]
:type children: [type]
:param parent: [description]
:type parent: [type]
:return: [description]
:rtype: [type]
"""
c = ipaddress.ip_network(children)
p = ipaddress.ip_network(parent)

if not c.subnet_of(p) or c == p:
return False
else:
return c.subnet_of(p)
if not c.subnet_of(p) or c == p:
return False
else:
return c.subnet_of(p)

0 comments on commit e0efd95

Please sign in to comment.