diff --git a/roles/osm-vector-maps/templates/iiab-update-map b/roles/osm-vector-maps/templates/iiab-update-map index 3d72bba62..837bc9e85 100755 --- a/roles/osm-vector-maps/templates/iiab-update-map +++ b/roles/osm-vector-maps/templates/iiab-update-map @@ -192,14 +192,11 @@ def fetch_menu_json_value(key): return data.get(key,'') def extract_region_from_filename(fname): - substitutions = { "north": "north_america",\ - "central": "central_america",\ - "southeast": "southeast_asia", - "south": "south_america" } - # wish I had used - as separator between key and date - nibble = fname.split('_')[0] - nibble = substitutions.get(nibble,nibble) - return(nibble) + nibble = re.search(r"^.._osm_..._(.*)_[0-9]{4}",fname) + if not nibble: + return("maplist") + resp = nibble.group(1) + return(resp) if __name__ == '__main__': if console_installed: