示例#1
0
    def power_on(self):
        """call rpm_client to power on AP"""
        rpm_client.set_power(self.get_wan_host(), 'ON')

        # Hard coded timer for now to wait for the AP to come alive
        # before trying to use it.  We need scanning code
        # to scan until the AP becomes available (crosbug.com/36710).
        time.sleep(TIMEOUT)
    def power_cycle(self):
        """Cycle power to this host via PoE if it is a lab device.

        @raises AutoservRepairError if it fails to power cycle the
                servo host.

        """
        if self.has_power():
            try:
                rpm_client.set_power(self.hostname, 'CYCLE')
            except (socket.error, xmlrpclib.Error, httplib.BadStatusLine,
                    rpm_client.RemotePowerException) as e:
                raise hosts.AutoservRepairError('Power cycling %s failed: %s' %
                                                (self.hostname, e))
        else:
            logging.info('Skipping power cycling, not a lab device.')
示例#3
0
 def power_off(self):
     """call rpm_client to power off AP"""
     rpm_client.set_power(self.get_wan_host(), 'OFF')