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 <[email protected]>
  • Loading branch information
liambeguin committed Feb 2, 2024
1 parent 2d6f93c commit e6c1662
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions contrib/sync-places.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ 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) or not isinstance(v, str):
del(tags[k])
tags[str(k)] = str(v)

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

0 comments on commit e6c1662

Please sign in to comment.