[autotest] fix a bug in rpm_dispatcher
This fixed a bug introduced in CL:212357
We need to stop trying if an rpm power state request
failed.
BUG=chromium:212346
TEST=unittest; Integration tests with other cls in this series, set
up a local rpm server and power cycle devices. Make sure
the bug goes away.
Change-Id: I39d9e7fce464a762bca4847de33e7e2c59317e5b
Reviewed-on: https://chromium-review.googlesource.com/216840
Reviewed-by: Dan Shi <dshi@chromium.org>
Reviewed-by: Simran Basi <sbasi@chromium.org>
Tested-by: Fang Deng <fdeng@chromium.org>
Commit-Queue: Fang Deng <fdeng@chromium.org>
diff --git a/site_utils/rpm_control_system/rpm_dispatcher.py b/site_utils/rpm_control_system/rpm_dispatcher.py
index 25fca6d..7adfded 100755
--- a/site_utils/rpm_control_system/rpm_dispatcher.py
+++ b/site_utils/rpm_control_system/rpm_dispatcher.py
@@ -128,13 +128,10 @@
powerunit_info = utils.PowerUnitInfo(**powerunit_info_dict)
logging.info('Received request to set device: %s to state: %s',
powerunit_info.device_hostname, new_state)
- result = False
- while not result:
- rpm_controller = self._get_rpm_controller(
- powerunit_info.powerunit_hostname,
- powerunit_info.hydra_hostname)
- result = rpm_controller.queue_request(powerunit_info, new_state)
- return result
+ rpm_controller = self._get_rpm_controller(
+ powerunit_info.powerunit_hostname,
+ powerunit_info.hydra_hostname)
+ return rpm_controller.queue_request(powerunit_info, new_state)
def _get_rpm_controller(self, rpm_hostname, hydra_hostname=None):