make migrator walk the "cloud" path also

the migrator was not renaming items in the "cloud" semaphore path.
Those were items that would run once only.

Now we just check both ipath('sem') and cpath('sem')
This commit is contained in:
Scott Moser 2012-11-13 15:25:57 -05:00
parent 10299836d1
commit 01be0255f3

View File

@ -28,10 +28,11 @@ frequency = PER_ALWAYS
def _migrate_canon_sems(cloud):
sem_path = cloud.paths.get_ipath('sem')
if not sem_path or not os.path.exists(sem_path):
return 0
paths = (cloud.paths.get_ipath('sem'), cloud.paths.get_cpath('sem'))
am_adjusted = 0
for sem_path in paths:
if not sem_path or not os.path.exists(sem_path):
continue
for p in os.listdir(sem_path):
full_path = os.path.join(sem_path, p)
if os.path.isfile(full_path):
@ -45,15 +46,16 @@ def _migrate_canon_sems(cloud):
def _migrate_legacy_sems(cloud, log):
sem_path = cloud.paths.get_ipath('sem')
if not sem_path or not os.path.exists(sem_path):
return
legacy_adjust = {
'apt-update-upgrade': [
'apt-configure',
'package-update-upgrade-install',
],
}
paths = (cloud.paths.get_ipath('sem'), cloud.paths.get_cpath('sem'))
for sem_path in paths:
if not sem_path or not os.path.exists(sem_path):
continue
sem_helper = helpers.FileSemaphores(sem_path)
for (mod_name, migrate_to) in legacy_adjust.items():
possibles = [mod_name, helpers.canon_sem_name(mod_name)]