Check correctly if device exists

config.ini has spaces around the equals sign
This commit is contained in:
Ire
2021-07-09 10:56:29 +02:00
committed by GitHub
parent caf2cb2cd8
commit f5e86d5806
+1 -1
View File
@@ -56,7 +56,7 @@ def is_initialized(device_name) -> bool:
if os.path.exists(config_path):
logger.info('Found existing config file at {}.'.format(config_path))
with open(config_path, 'r') as f:
if any('hw.device.name={}'.format(device_name) in line for line in f):
if any('hw.device.name = {}'.format(device_name) in line for line in f):
logger.info('Existing config file references {}. Assuming device was previously initialized.'.format(device_name))
return True
else: