2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-12-24 12:11:52 +00:00

Fix python3 issues in ssdp code

In the ssdp code, there were python3 specific issues.
This commit is contained in:
Jarrod Johnson 2020-07-15 13:06:54 -04:00
parent d792822f4b
commit ac308fbd9c

View File

@ -278,7 +278,7 @@ def _find_service(service, target):
for url in peerdata[nid].get('urls', ()):
if url.endswith('/desc.tmpl'):
info = urlopen(url).read()
if '<friendlyName>Athena</friendlyName>' in info:
if b'<friendlyName>Athena</friendlyName>' in info:
peerdata[nid]['services'] = ['service:thinkagile-storage']
yield peerdata[nid]
@ -292,10 +292,10 @@ def _parse_ssdp(peer, rsp, peerdata):
mac = nid
headlines = rsp.split(b'\r\n')
try:
_, code, _ = headlines[0].split(' ', 2)
_, code, _ = headlines[0].split(b' ', 2)
except ValueError:
return
if code == '200':
if code == b'200':
if nid in peerdata:
peerdatum = peerdata[nid]
if peer not in peerdatum['addresses']: