Skip to content

Commit e6c1662

Browse files
committed
contrib: sync-places: convert tags into strings
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>
1 parent 2d6f93c commit e6c1662

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

contrib/sync-places.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@ async def do_sync(session, args):
109109
changed = True
110110

111111
tags = config["places"][name].get("tags", {}).copy()
112+
for k, v in tags.items():
113+
if not isinstance(k, str) or not isinstance(v, str):
114+
del(tags[k])
115+
tags[str(k)] = str(v)
116+
112117
if place_tags != tags:
113118
print(
114119
"Setting tags for place %s to %s"

0 commit comments

Comments
 (0)