From 2549018c81ad6fcc67a3dc89dec18d2310ce2235 Mon Sep 17 00:00:00 2001 From: Michael Still Date: Fri, 11 May 2012 14:54:34 +1000 Subject: Provide a transition to new .info files. Change-Id: I2fb6ef93c0652a797dba72cf75fb78baaa9c9c5a --- nova/virt/libvirt/utils.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'nova/virt') 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) -- cgit