From 33e7d5769916e6799426ac48edc0337bdbb7cb8c Mon Sep 17 00:00:00 2001 From: Russell Haering Date: Tue, 14 Jan 2014 21:27:34 -0800 Subject: [PATCH] replace StandbyAgent with StandyMode --- teeth_agent/standby.py | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/teeth_agent/standby.py b/teeth_agent/standby.py index 308ec9809..54caf51ba 100644 --- a/teeth_agent/standby.py +++ b/teeth_agent/standby.py @@ -132,25 +132,12 @@ class RunImageCommand(base.AsyncCommandResult): _run_image() -class StandbyAgent(base.BaseTeethAgent): - def __init__(self, - listen_host, - listen_port, - advertise_host, - advertise_port, - api_url): - super(StandbyAgent, self).__init__(listen_host, - listen_port, - advertise_host, - advertise_port, - api_url, - 'STANDBY') - - self.command_map = { - 'cache_images': self.cache_images, - 'prepare_image': self.prepare_image, - 'run_image': self.run_image, - } +class StandbyMode(base.BaseAgentMode): + def __init__(self): + super(StandbyMode, self).__init__('STANDBY') + self['cache_images'] = self.cache_images + self['prepare_image'] = self.prepare_image + self['run_image'] = self.run_image def _validate_image_info(self, image_info): for field in ['id', 'urls', 'hashes']: