Add debug
This commit is contained in:
parent
1a8dcfc0d9
commit
afe07f9d00
1 changed files with 7 additions and 4 deletions
11
odi6/odi6.py
11
odi6/odi6.py
|
@ -157,10 +157,9 @@ same target, doing nothing."""
|
||||||
if self.config['ip_method'] == 'value':
|
if self.config['ip_method'] == 'value':
|
||||||
if self.config['ip']:
|
if self.config['ip']:
|
||||||
return self.config['ip'], self.config['ipv6']
|
return self.config['ip'], self.config['ipv6']
|
||||||
else:
|
self._log.error(
|
||||||
self._log.error(
|
'Selected "value" method but no IP (v4) address indicated.'
|
||||||
'Selected "value" method but no IP (v4) address indicated.'
|
)
|
||||||
)
|
|
||||||
elif self.config['ip_method'] == 'interface':
|
elif self.config['ip_method'] == 'interface':
|
||||||
try:
|
try:
|
||||||
iface = netifaces.ifaddresses(self.config['network_interface'])
|
iface = netifaces.ifaddresses(self.config['network_interface'])
|
||||||
|
@ -190,6 +189,10 @@ same target, doing nothing."""
|
||||||
ipv4 = match.group(0).decode()
|
ipv4 = match.group(0).decode()
|
||||||
try:
|
try:
|
||||||
result = s.get(self.config['web_service_url_ipv6'])
|
result = s.get(self.config['web_service_url_ipv6'])
|
||||||
|
self._log.debug(
|
||||||
|
"IPv6 web service result: %s",
|
||||||
|
result.content
|
||||||
|
)
|
||||||
match = re.match(
|
match = re.match(
|
||||||
br'[0-9a-f]{0,4}:?:[0-9a-f]{0,4}:?:[0-9a-f]{0,4}:?:[0-9a-f]{0,4}:?:[0-9a-f]{0,4}:?:[0-9a-f]{0,4}',
|
br'[0-9a-f]{0,4}:?:[0-9a-f]{0,4}:?:[0-9a-f]{0,4}:?:[0-9a-f]{0,4}:?:[0-9a-f]{0,4}:?:[0-9a-f]{0,4}',
|
||||||
result.content)
|
result.content)
|
||||||
|
|
Loading…
Reference in a new issue