deploy_chrome: Add an option to control pinging the device.

Don't ping the device by default, as we are already testing the
connection to it in _CheckConnection, by adding a '--ping' commandline
option and making if false by default.

BUG=None
TEST=run with and without the --ping argument, verify target
pinged/not

Change-Id: I71428fd760432c8160f1dd522f50ae7e4e1a85f9
Reviewed-on: https://chromium-review.googlesource.com/237051
Trybot-Ready: Pawel Osciak <posciak@chromium.org>
Tested-by: Pawel Osciak <posciak@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Pawel Osciak <posciak@chromium.org>
diff --git a/scripts/deploy_chrome.py b/scripts/deploy_chrome.py
index c17aef2..36befec 100644
--- a/scripts/deploy_chrome.py
+++ b/scripts/deploy_chrome.py
@@ -99,7 +99,8 @@
     self.options = options
     self.staging_dir = staging_dir
     if not self.options.staging_only:
-      self.device = remote.RemoteDevice(options.to, port=options.port)
+      self.device = remote.RemoteDevice(options.to, port=options.port,
+                                        ping=options.ping)
     self._target_dir_is_still_readonly = multiprocessing.Event()
 
     self.copy_paths = chrome_util.GetCopyPaths('chrome')
@@ -418,6 +419,8 @@
   group.add_option('--strip-flags', default=None,
                    help="Flags to call the 'strip' binutil tool with.  "
                         "Overrides the default arguments.")
+  group.add_option('--ping', action='store_true', default=False,
+                   help='Ping the device before connection attempt.')
   parser.add_option_group(group)
 
   group = optparse.OptionGroup(parser, 'Metadata Overrides (Advanced)',