mirror of
https://opendev.org/x/pyghmi
synced 2025-11-10 08:00:37 +00:00
Fix NTP configuration of FPC/SMM with py3
Under pythton3, we have another case of one thing defaulting to bytes and a str. Explicitly decode from utf8 in such a case. Change-Id: Icbf6ad375e6398d12656ab4ddc8d0f248fe1cc73
This commit is contained in:
@@ -634,6 +634,8 @@ class SMMClient(object):
|
||||
1 if enabled else 0))
|
||||
rsp = self.wc.getresponse()
|
||||
result = rsp.read()
|
||||
if not isinstance(result, str):
|
||||
result = result.decode('utf8')
|
||||
self.logout()
|
||||
if '<status>ok</status>' not in result:
|
||||
raise Exception("Unrecognized result: " + result)
|
||||
@@ -643,6 +645,8 @@ class SMMClient(object):
|
||||
index + 1, server))
|
||||
rsp = self.wc.getresponse()
|
||||
result = rsp.read()
|
||||
if not isinstance(result, str):
|
||||
result = result.decode('utf8')
|
||||
if '<status>ok</status>' not in result:
|
||||
raise Exception("Unrecognized result: " + result)
|
||||
self.logout()
|
||||
|
||||
Reference in New Issue
Block a user