cros_update: Fix starting cros_update in devserver

CL:1865147 and CL:1871765 did not properly test the use case of
cros_update through autoupdate_Endtoendtest and it is now failing those
tests (we haven't had a devserver push, but if we had, those tests would
be failing now.). The reason was that I moved the cros_update to
chromite and updated devserver to use the new code, but when I got
feedback that we need to fix the cros_update in its original repo first,
I forgot to fix the caller of cros_update and test it with endtoend
tests. So this happened.

This CL moves back calling cros_update.py to what it was before except
that we don't pass shell=True (default is False) anymore since we're
passing the arguments as a list I guess (it doesn't work with
shell=True).

BUG=chromium:1018237, chromium:1003986
TEST=autoupdate_EndToEndTest (look in the control file):
test_that 100.90.30.183 autoupdate_EndToEndTest --args="target_release=12630.0.0 target_payload_uri='gs://chromeos-releases/canary-channel/reef/12630.0.0/payloads/chromeos_12630.0.0_reef_canary-channel_full_test.bin-gvsgentbhe3weyrvxdf7m2jmagoju4pw'"

Change-Id: I1223a5cbc0d22078beaa31aad3486501152efe56
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/dev-util/+/1888436
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Achuith Bhandarkar <achuith@chromium.org>
Tested-by: Amin Hassani <ahassani@chromium.org>
diff --git a/devserver.py b/devserver.py
index ef5f585..0d8aa07 100755
--- a/devserver.py
+++ b/devserver.py
@@ -794,8 +794,10 @@
 
     if is_async:
       # Command of running auto-update.
-      cmd = ['cros_update', '-d', host_name, '-b', build_name, '--static_dir',
-             updater.static_dir]
+      path = os.path.dirname(os.path.abspath(__file__))
+      execute_file = os.path.join(path, 'cros_update.py')
+      cmd = ['/usr/bin/python', '-u', execute_file, '-d', host_name,
+             '-b', build_name, '--static_dir', updater.static_dir]
 
       # The original_build's format is like: link/3428.210.0
       # The corresponding release_archive_url's format is like:
@@ -828,7 +830,7 @@
       if static_url:
         cmd += ['--static_url', static_url]
 
-      p = subprocess.Popen(cmd, shell=True, preexec_fn=os.setsid)
+      p = subprocess.Popen(cmd, preexec_fn=os.setsid)
       pid = os.getpgid(p.pid)
 
       # Pre-write status in the track_status_file before the first call of
@@ -841,8 +843,8 @@
       cros_update_trigger = cros_update.CrOSUpdateTrigger(
           host_name, build_name, updater.static_dir, force_update=force_update,
           full_update=full_update, original_build=original_build,
-          quick_provision=quick_provision, devserver_url=devserver_url,
-          static_url=static_url)
+          payload_filename=payload_filename, quick_provision=quick_provision,
+          devserver_url=devserver_url, static_url=static_url)
       cros_update_trigger.TriggerAU()
       return json.dumps((True, -1))