diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-05-11 16:28:31 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-05-11 16:28:31 +0000 |
| commit | 15e774deb83c039bf6d07386fa5ce6b76e12e034 (patch) | |
| tree | 05381efff4a82b58982818ad8080f9af206115cd /nova/virt | |
| parent | 8374ba0f03f5038be2868da988f5d06468a68544 (diff) | |
| parent | 2549018c81ad6fcc67a3dc89dec18d2310ce2235 (diff) | |
Merge "Provide a transition to new .info files."
Diffstat (limited to 'nova/virt')
| -rw-r--r-- | nova/virt/libvirt/utils.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/nova/virt/libvirt/utils.py b/nova/virt/libvirt/utils.py index f4c6d20a5..cfc47b202 100644 --- a/nova/virt/libvirt/utils.py +++ b/nova/virt/libvirt/utils.py @@ -342,7 +342,19 @@ def read_stored_info(base_path, field=None): info_file = get_info_filename(base_path) if not os.path.exists(info_file): - d = {} + # Special case to handle essex checksums being converted + old_filename = base_path + '.sha1' + if field == 'sha1' and os.path.exists(old_filename): + hash_file = open(old_filename) + hash_value = hash_file.read() + hash_file.close() + + write_stored_info(base_path, field=field, value=hash_value) + os.remove(old_filename) + d = {field: hash_value} + + else: + d = {} else: LOG.info(_('Reading image info file: %s'), info_file) |
