From 772ab434603760a8849164682cca92c62dd3d877 Mon Sep 17 00:00:00 2001 From: Jim Rollenhagen Date: Thu, 20 Feb 2014 13:04:26 -0800 Subject: [PATCH] check for cached image in cache_image as well --- teeth_agent/standby.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/teeth_agent/standby.py b/teeth_agent/standby.py index 29d83aa3d..43df5c621 100644 --- a/teeth_agent/standby.py +++ b/teeth_agent/standby.py @@ -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,