check for cached image in cache_image as well

This commit is contained in:
Jim Rollenhagen 2014-02-20 13:04:26 -08:00
parent de99db16ae
commit 772ab43460

View File

@ -162,13 +162,13 @@ class StandbyMode(base.BaseAgentMode):
self.cached_image_id = None
@decorators.async_command(_validate_image_info)
def cache_image(self, command_name, image_info=None):
def cache_image(self, command_name, image_info=None, force=False):
device = hardware.get_manager().get_os_install_device()
_download_image(image_info)
_write_image(image_info, device)
self.cached_image_id = image_info['id']
if self.cached_image_id != image_info['id'] or force:
_download_image(image_info)
_write_image(image_info, device)
self.cached_image_id = image_info['id']
@decorators.async_command(_validate_image_info)
def prepare_image(self,