More consistency
This commit is contained in:
parent
537519dea6
commit
806efa1fc2
@ -434,7 +434,7 @@ class BTTether(plugins.Plugin):
|
|||||||
'max_tries', 'share_internet', 'mac', 'ip',
|
'max_tries', 'share_internet', 'mac', 'ip',
|
||||||
'netmask', 'interval']:
|
'netmask', 'interval']:
|
||||||
if device_opt not in options or (device_opt in options and options[device_opt] is None):
|
if device_opt not in options or (device_opt in options and options[device_opt] is None):
|
||||||
logging.error("BT-TET: Please specify the %s for device %s.",
|
logging.error("BT-TETHER: Please specify the %s for device %s.",
|
||||||
device_opt, device)
|
device_opt, device)
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
@ -445,20 +445,20 @@ class BTTether(plugins.Plugin):
|
|||||||
if 'mac' in self.options:
|
if 'mac' in self.options:
|
||||||
for opt in ['share_internet', 'mac', 'ip', 'netmask', 'interval']:
|
for opt in ['share_internet', 'mac', 'ip', 'netmask', 'interval']:
|
||||||
if opt not in self.options or (opt in self.options and self.options[opt] is None):
|
if opt not in self.options or (opt in self.options and self.options[opt] is None):
|
||||||
logging.error("BT-TET: Please specify the %s in your config.yml.", opt)
|
logging.error("BT-TETHER: Please specify the %s in your config.yml.", opt)
|
||||||
return
|
return
|
||||||
|
|
||||||
self.devices['legacy'] = Device(name='legacy', **self.options)
|
self.devices['legacy'] = Device(name='legacy', **self.options)
|
||||||
|
|
||||||
if not self.devices:
|
if not self.devices:
|
||||||
logging.error("BT-TET: No valid devices found")
|
logging.error("BT-TETHER: No valid devices found")
|
||||||
return
|
return
|
||||||
|
|
||||||
# ensure bluetooth is running
|
# ensure bluetooth is running
|
||||||
bt_unit = SystemdUnitWrapper('bluetooth.service')
|
bt_unit = SystemdUnitWrapper('bluetooth.service')
|
||||||
if not bt_unit.is_active():
|
if not bt_unit.is_active():
|
||||||
if not bt_unit.start():
|
if not bt_unit.start():
|
||||||
logging.error("BT-TET: Can't start bluetooth.service")
|
logging.error("BT-TETHER: Can't start bluetooth.service")
|
||||||
return
|
return
|
||||||
|
|
||||||
logging.info("BT-TETHER: Sussessfully loaded ...")
|
logging.info("BT-TETHER: Sussessfully loaded ...")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user