Merge pull request #41 from jasonmhite/master
Optionally skip MAC address check in network
This commit is contained in:
commit
5c2c3fc533
@ -98,10 +98,15 @@ class Network(IntervalModule):
|
|||||||
up = netifaces.AF_INET in info or netifaces.AF_INET6 in info
|
up = netifaces.AF_INET in info or netifaces.AF_INET6 in info
|
||||||
fdict = dict(
|
fdict = dict(
|
||||||
zip_longest(["v4", "v4mask", "v4cidr", "v6", "v6mask", "v6cidr"], [], fillvalue=""))
|
zip_longest(["v4", "v4mask", "v4cidr", "v6", "v6mask", "v6cidr"], [], fillvalue=""))
|
||||||
|
|
||||||
|
try:
|
||||||
|
mac = info[netifaces.AF_PACKET][0]["addr"]
|
||||||
|
except KeyError:
|
||||||
|
mac = "NONE"
|
||||||
fdict.update({
|
fdict.update({
|
||||||
"interface": self.interface,
|
"interface": self.interface,
|
||||||
"name": self.name,
|
"name": self.name,
|
||||||
"mac": info[netifaces.AF_PACKET][0]["addr"],
|
"mac": mac,
|
||||||
})
|
})
|
||||||
|
|
||||||
if up:
|
if up:
|
||||||
|
Loading…
Reference in New Issue
Block a user