Skip to content

Commit

Permalink
fix prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
y-du committed Jun 6, 2024
1 parent bf9c62e commit 65c9061
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion blebox/discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@ def validate_hosts_worker(hosts, valid_hosts):
resp = resp.json()
if "device" in resp.keys():
resp = resp["device"]
valid_hosts["{}{}".format(conf.Discovery.device_id_prefix, resp['id'])] = {
prefix = ""
if conf.Discovery.device_id_prefix is not None:
prefix = conf.Discovery.device_id_prefix
valid_hosts["{}{}".format(prefix, resp['id'])] = {
"name": resp["deviceName"],
"ip_address": host
}
Expand Down

0 comments on commit 65c9061

Please sign in to comment.