Skip to content

Commit 96c4f88

Browse files
committed
Pull in PR #380 to see if that fixes the spurious CI test failures as
speculated in that PR description. We would prefer to avoid mixing them up in this test-only PR but unfortunately I'm completely unable to trigger similar failures locally. So if it solves the problems I'll merge PR #380 and rebase this one on it before merge to keep them apart.
1 parent b5a0ae2 commit 96c4f88

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

mig/shared/vgridaccess.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -401,18 +401,18 @@ def refresh_vgrid_map(configuration, clean=False):
401401
optional_conf = [SETTINGS, ]
402402

403403
for vgrid in all_vgrids:
404+
# Make sure vgrid dict exists before filling it
405+
vgrid_map[VGRIDS][vgrid] = vgrid_map[VGRIDS].get(vgrid, {})
404406
for (field, name, list_call) in conf_read:
405407
conf_path = os.path.join(configuration.vgrid_home, vgrid, name)
406408
if not os.path.isfile(conf_path):
407-
# Make sure vgrid dict exists before filling it
408-
vgrid_map[VGRIDS][vgrid] = vgrid_map[VGRIDS].get(vgrid, {})
409409
vgrid_map[VGRIDS][vgrid][field] = []
410410
if vgrid != default_vgrid and field not in optional_conf:
411411
_logger.warning('missing file: %s' %
412412
conf_path)
413413
dirty[VGRIDS] = dirty.get(VGRIDS, []) + [vgrid]
414414

415-
elif vgrid not in vgrid_map[VGRIDS] or \
415+
elif field not in vgrid_map[VGRIDS][vgrid] or \
416416
os.path.getmtime(conf_path) >= map_stamp:
417417
(status, entries) = list_call(vgrid, configuration,
418418
recursive=False)
@@ -425,6 +425,8 @@ def refresh_vgrid_map(configuration, clean=False):
425425
vgrid_map[VGRIDS][vgrid] = map_entry
426426
vgrid_map[VGRIDS][vgrid][field] = entries
427427
dirty[VGRIDS] = dirty.get(VGRIDS, []) + [vgrid]
428+
else:
429+
_logger.debug("caching %s for %s in vgrid map" % (name, vgrid))
428430
# Remove any missing vgrids from map
429431
missing_vgrids = [vgrid for vgrid in vgrid_map[VGRIDS]
430432
if not vgrid in all_vgrids]
@@ -853,7 +855,6 @@ def check_vgrid_access(configuration, client_id, vgrid_name, recursive=True,
853855
the vgrid module and should replace that one everywhere that only vgrid map
854856
(cached) lookups are needed.
855857
"""
856-
vgrid_access = [default_vgrid]
857858
vgrid_map = get_vgrid_map(configuration, recursive, caching)
858859
vgrid_entry = vgrid_map.get(VGRIDS, {}).get(
859860
vgrid_name, {OWNERS: [], MEMBERS: []})

0 commit comments

Comments
 (0)