|
|
@ -2263,6 +2263,12 @@ class LinuxNetwork(Network):
|
|
|
|
- ipv4_address and ipv6_address: the first non-local address for each family.
|
|
|
|
- ipv4_address and ipv6_address: the first non-local address for each family.
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
platform = 'Linux'
|
|
|
|
platform = 'Linux'
|
|
|
|
|
|
|
|
INTERFACE_TYPE = {
|
|
|
|
|
|
|
|
'1': 'ether',
|
|
|
|
|
|
|
|
'512': 'ppp',
|
|
|
|
|
|
|
|
'772': 'loopback',
|
|
|
|
|
|
|
|
'65534': 'tunnel',
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
def populate(self):
|
|
|
|
def populate(self):
|
|
|
|
ip_path = self.module.get_bin_path('ip')
|
|
|
|
ip_path = self.module.get_bin_path('ip')
|
|
|
@ -2336,12 +2342,7 @@ class LinuxNetwork(Network):
|
|
|
|
interfaces[device]['module'] = os.path.basename(os.path.realpath(os.path.join(path, 'device', 'driver', 'module')))
|
|
|
|
interfaces[device]['module'] = os.path.basename(os.path.realpath(os.path.join(path, 'device', 'driver', 'module')))
|
|
|
|
if os.path.exists(os.path.join(path, 'type')):
|
|
|
|
if os.path.exists(os.path.join(path, 'type')):
|
|
|
|
_type = get_file_content(os.path.join(path, 'type'))
|
|
|
|
_type = get_file_content(os.path.join(path, 'type'))
|
|
|
|
if _type == '1':
|
|
|
|
interfaces[device]['type'] = self.INTERFACE_TYPE.get(_type, 'unknown')
|
|
|
|
interfaces[device]['type'] = 'ether'
|
|
|
|
|
|
|
|
elif _type == '512':
|
|
|
|
|
|
|
|
interfaces[device]['type'] = 'ppp'
|
|
|
|
|
|
|
|
elif _type == '772':
|
|
|
|
|
|
|
|
interfaces[device]['type'] = 'loopback'
|
|
|
|
|
|
|
|
if os.path.exists(os.path.join(path, 'bridge')):
|
|
|
|
if os.path.exists(os.path.join(path, 'bridge')):
|
|
|
|
interfaces[device]['type'] = 'bridge'
|
|
|
|
interfaces[device]['type'] = 'bridge'
|
|
|
|
interfaces[device]['interfaces'] = [ os.path.basename(b) for b in glob.glob(os.path.join(path, 'brif', '*')) ]
|
|
|
|
interfaces[device]['interfaces'] = [ os.path.basename(b) for b in glob.glob(os.path.join(path, 'brif', '*')) ]
|
|
|
|