Move get_lab_servo() from cros.servo to hosts.site_host.

In order to replace the server.cros.servo module with a client side
Servo API, it's necessary to move small amounts of content out of
the 'servo' module into other classes within autotest.  This change
moves the code for creating Servo objects for hosts in the .cros
zone from the servo module into site_host.

BUG=chromium-os:36973
TEST=platform_LongPressPower on a servo DUT in the .cros lab

Change-Id: I00aabfd73fb85f15e5a2141727781d4eb58289bb
Reviewed-on: https://gerrit.chromium.org/gerrit/43070
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Commit-Queue: Richard Barnette <jrbarnette@chromium.org>
diff --git a/server/cros/servo.py b/server/cros/servo.py
index 9b8d1e2..99716bf 100644
--- a/server/cros/servo.py
+++ b/server/cros/servo.py
@@ -101,37 +101,6 @@
 
     KEY_MATRIX = [KEY_MATRIX_ALT_0, KEY_MATRIX_ALT_1, KEY_MATRIX_ALT_2]
 
-    @staticmethod
-    def _make_servo_hostname(hostname):
-        host_parts = hostname.split('.')
-        host_parts[0] = host_parts[0] + '-servo'
-        return '.'.join(host_parts)
-
-    @staticmethod
-    def get_lab_servo(target_hostname):
-        """Instantiate a Servo for |target_hostname| in the lab.
-
-        Assuming that |target_hostname| is a device in the CrOS test
-        lab, create and return a Servo object pointed at the servo
-        attached to that DUT.  The servo in the test lab is assumed
-        to already have servod up and running on it.
-
-        @param target_hostname: device whose servo we want to target.
-        @return an appropriately configured Servo
-        """
-        servo_host = Servo._make_servo_hostname(target_hostname)
-        if utils.host_is_in_lab_zone(servo_host):
-            try:
-                return Servo(servo_host=servo_host, target_host=target_hostname)
-            except: # pylint: disable=W0702
-                # TODO(jrbarnette):  Long-term, if we can't get to
-                # a servo in the lab, we want to fail, so we should
-                # pass any exceptions along.  Short-term, we're not
-                # ready to rely on servo, so we ignore failures.
-                pass
-        return None
-
-
     def __init__(self, servo_host='localhost', target_host=None,
                  servo_port=9999):
         """Sets up the servo communication infrastructure.
diff --git a/server/hosts/site_host.py b/server/hosts/site_host.py
index be7c022..ccdd479 100644
--- a/server/hosts/site_host.py
+++ b/server/hosts/site_host.py
@@ -40,6 +40,37 @@
     models = None
 
 
+def _make_servo_hostname(hostname):
+    host_parts = hostname.split('.')
+    host_parts[0] = host_parts[0] + '-servo'
+    return '.'.join(host_parts)
+
+
+def _get_lab_servo(target_hostname):
+    """Instantiate a Servo for |target_hostname| in the lab.
+
+    Assuming that |target_hostname| is a device in the CrOS test
+    lab, create and return a Servo object pointed at the servo
+    attached to that DUT.  The servo in the test lab is assumed
+    to already have servod up and running on it.
+
+    @param target_hostname: device whose servo we want to target.
+    @return an appropriately configured Servo instance.
+    """
+    servo_host = _make_servo_hostname(target_hostname)
+    if utils.host_is_in_lab_zone(servo_host):
+        try:
+            return servo.Servo(
+                    servo_host=servo_host, target_host=target_hostname)
+        except: # pylint: disable=W0702
+            # TODO(jrbarnette):  Long-term, if we can't get to
+            # a servo in the lab, we want to fail, so we should
+            # pass any exceptions along.  Short-term, we're not
+            # ready to rely on servo, so we ignore failures.
+            pass
+    return None
+
+
 def make_ssh_command(user='root', port=22, opts='', hosts_file=None,
                      connect_timeout=None, alive_interval=None):
     """Override default make_ssh_command to use options tuned for Chrome OS.
@@ -199,7 +230,7 @@
         # errors that might happen.
         self.env['LIBC_FATAL_STDERR_'] = '1'
         self._xmlrpc_proxy_map = {}
-        self.servo = servo.Servo.get_lab_servo(hostname)
+        self.servo = _get_lab_servo(hostname)
         if not self.servo and servo_args is not None:
             self.servo = servo.Servo(**servo_args)