mirror of
https://github.com/xcat2/confluent.git
synced 2025-02-12 08:40:24 +00:00
Fix handling autosense with python3
This commit is contained in:
parent
73d6511d9e
commit
186e89cd87
@ -91,6 +91,11 @@ import eventlet.semaphore
|
||||
autosensors = set()
|
||||
scanner = None
|
||||
|
||||
try:
|
||||
unicode
|
||||
except NameError:
|
||||
unicode = str
|
||||
|
||||
class nesteddict(dict):
|
||||
|
||||
def __missing__(self, key):
|
||||
@ -371,7 +376,7 @@ def handle_autosense_config(operation, inputdata):
|
||||
yield msg.KeyValueData({'enabled': autosense})
|
||||
elif operation == 'update':
|
||||
enabled = inputdata['enabled']
|
||||
if type(enabled) in (unicode, str):
|
||||
if type(enabled) in (unicode, bytes):
|
||||
enabled = enabled.lower() in ('true', '1', 'y', 'yes', 'enable',
|
||||
'enabled')
|
||||
if autosense == enabled:
|
||||
|
Loading…
x
Reference in New Issue
Block a user