diff options
author | harlowja <harlowja@virtualbox.rhel> | 2012-11-07 23:20:40 -0800 |
---|---|---|
committer | harlowja <harlowja@virtualbox.rhel> | 2012-11-07 23:20:40 -0800 |
commit | 196badd4cfa5f9f76be1138fb2d073649af3e031 (patch) | |
tree | 236f5aaf57becbb24f7ec03c6d7b46204cc8077f /cloudinit/config/cc_migrator.py | |
parent | 3de3c535f37e40a79b36997a93fa218534117397 (diff) | |
download | vyos-cloud-init-196badd4cfa5f9f76be1138fb2d073649af3e031.tar.gz vyos-cloud-init-196badd4cfa5f9f76be1138fb2d073649af3e031.zip |
1. Ensure that the sem_path exists and
is actually a valid value returned.
2. Adjust variable naming
Diffstat (limited to 'cloudinit/config/cc_migrator.py')
-rw-r--r-- | cloudinit/config/cc_migrator.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cloudinit/config/cc_migrator.py b/cloudinit/config/cc_migrator.py index 56f33d42..58232fc9 100644 --- a/cloudinit/config/cc_migrator.py +++ b/cloudinit/config/cc_migrator.py @@ -46,14 +46,16 @@ def _migrate_canon_sems(cloud): def _migrate_legacy_sems(cloud, log): sem_path = cloud.paths.get_ipath('sem') - touch_there = { + if not sem_path or not os.path.exists(sem_path): + return + legacy_adjust = { 'apt-update-upgrade': [ 'apt-configure', 'package-update-upgrade-install', ], } sem_helper = helpers.FileSemaphores(sem_path) - for (mod_name, migrate_to) in touch_there.items(): + for (mod_name, migrate_to) in legacy_adjust.items(): possibles = [mod_name, helpers.canon_sem_name(mod_name)] old_exists = [] for p in os.listdir(sem_path): |