dump_devinfo: handle latitude/longitude keys properly (#175)

* also, -d/--debug is now a flag
This commit is contained in:
Teemu R 2021-06-19 21:46:36 +02:00 committed by GitHub
parent 0aa20f6cf9
commit 799032a8df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -41,7 +41,7 @@ def scrub(res):
res[k] = scrub(res.get(k)) res[k] = scrub(res.get(k))
else: else:
if k in keys_to_scrub: if k in keys_to_scrub:
if k in ["latitude_i", "longitude_i"]: if k in ["latitude", "latitude_i", "longitude", "longitude_i"]:
v = 0 v = 0
else: else:
v = re.sub(r"\w", "0", v) v = re.sub(r"\w", "0", v)
@ -62,7 +62,7 @@ def default_to_regular(d):
@click.command() @click.command()
@click.argument("host") @click.argument("host")
@click.option("--debug") @click.option("-d", "--debug", is_flag=True)
def cli(host, debug): def cli(host, debug):
"""Generate devinfo file for given device.""" """Generate devinfo file for given device."""
if debug: if debug: