Skip to content

Commit

Permalink
contrib: sync-places: convert tags into strings
Browse files Browse the repository at this point in the history
When settings tags from the command line, key, value pairs are always
strings. Make sure this is the same when reading a YAML file. It can
easily be done in the YAML file itself, but this makes the syntax a bit
lighter.

Signed-off-by: Liam Beguin <liambeguin@gmail.com>
  • Loading branch information
liambeguin committed Dec 4, 2023
1 parent 791ce4f commit d3dab9f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions contrib/sync-places.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,13 @@ async def do_sync(session, args):
changed = True

tags = config["places"][name].get("tags", {}).copy()
for k, v in tags.items():
if not isinstance(k, str):
tags[str(k)] = v
del(tags[k])
if not isinstance(v, str):
tags[k] = str(v)

if place_tags != tags:
print(
"Setting tags for place %s to %s"
Expand Down

0 comments on commit d3dab9f

Please sign in to comment.