Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / chromite / lib / remote_access.py
index c1e6719..6b917a1 100644 (file)
@@ -443,7 +443,7 @@ class RemoteDevice(object):
 
   def __init__(self, hostname, port=None, username=None,
                base_dir=DEFAULT_BASE_DIR, connect_settings=None,
-               private_key=None, debug_level=logging.DEBUG):
+               private_key=None, debug_level=logging.DEBUG, ping=True):
     """Initializes a RemoteDevice object.
 
     Args:
@@ -454,6 +454,7 @@ class RemoteDevice(object):
       connect_settings: Default SSH connection settings.
       private_key: The identify file to pass to `ssh -i`.
       debug_level: Setting debug level for logging.
+      ping: Whether to ping the device before attempting to connect.
     """
     self.hostname = hostname
     self.port = port
@@ -468,7 +469,7 @@ class RemoteDevice(object):
     # Setup a working directory on the device.
     self.base_dir = base_dir
 
-    if not self.Pingable():
+    if ping and not self.Pingable():
       raise DeviceNotPingable('Device %s is not pingable.' % self.hostname)
 
     # Do not call RunCommand here because we have not set up work directory yet.
@@ -668,7 +669,7 @@ class ChromiumOSDevice(RemoteDevice):
 
     return False
 
-  def _DisableRootfsVerification(self):
+  def DisableRootfsVerification(self):
     """Disables device rootfs verification."""
     logging.info('Disabling rootfs verification on device...')
     self.RunCommand(
@@ -698,7 +699,7 @@ class ChromiumOSDevice(RemoteDevice):
     # If the image is built with rootfs verification, turn off the
     # rootfs verification. After reboot, the rootfs will be mounted as
     # read-write (there is no need to remount).
-    self._DisableRootfsVerification()
+    self.DisableRootfsVerification()
 
     return not self._RootfsIsReadOnly()