Commit 72c7841c by Ryan Committed by Michael DeHaan

add module param to Network & sub-classes

add module param to Network and sub-classes of Network, so that ansible 1.5.1 changes to LinuxNetwork apply to all Network classes.
parent 42ca3d80
...@@ -1413,7 +1413,8 @@ class Network(Facts): ...@@ -1413,7 +1413,8 @@ class Network(Facts):
subclass = sc subclass = sc
return super(cls, subclass).__new__(subclass, *arguments, **keyword) return super(cls, subclass).__new__(subclass, *arguments, **keyword)
def __init__(self): def __init__(self, module):
self.module = module
Facts.__init__(self) Facts.__init__(self)
def populate(self): def populate(self):
...@@ -1430,11 +1431,10 @@ class LinuxNetwork(Network): ...@@ -1430,11 +1431,10 @@ class LinuxNetwork(Network):
platform = 'Linux' platform = 'Linux'
def __init__(self, module): def __init__(self, module):
self.module = module Network.__init__(self, module)
Network.__init__(self)
def populate(self): def populate(self):
ip_path = module.get_bin_path('ip') ip_path = self.module.get_bin_path('ip')
if ip_path is None: if ip_path is None:
return self.facts return self.facts
default_ipv4, default_ipv6 = self.get_default_interfaces(ip_path) default_ipv4, default_ipv6 = self.get_default_interfaces(ip_path)
...@@ -1650,8 +1650,8 @@ class GenericBsdIfconfigNetwork(Network): ...@@ -1650,8 +1650,8 @@ class GenericBsdIfconfigNetwork(Network):
""" """
platform = 'Generic_BSD_Ifconfig' platform = 'Generic_BSD_Ifconfig'
def __init__(self): def __init__(self, module):
Network.__init__(self) Network.__init__(self, module)
def populate(self): def populate(self):
......
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