get_latest_image: update usage

BUG=chromium:893754
TEST=precq

Change-Id: If39e41f7790cae7bc242cc2fff455f46215f4c97
Reviewed-on: https://chromium-review.googlesource.com/1292029
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Alex Klein <saklein@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
diff --git a/build_util.py b/build_util.py
index 0e8f680..c421c87 100644
--- a/build_util.py
+++ b/build_util.py
@@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
 # Copyright (c) 2009-2010 The Chromium OS Authors. All rights reserved.
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
@@ -20,6 +21,7 @@
     self.devserver_dir = os.path.dirname(os.path.abspath(sys.argv[0]))
     self.static_dir = static_dir
     self.scripts_dir = os.path.join(self.GetSourceRoot(), 'src/scripts')
+    self.images_dir = os.path.join(self.GetSourceRoot(), 'src/build/images')
 
   @staticmethod
   def GetSourceRoot():
@@ -32,8 +34,7 @@
 
   def GetLatestImageDir(self, board):
     """Returns the latest image dir based on shell script."""
-    cmd = '%s/get_latest_image.sh --board %s' % (self.scripts_dir, board)
-    return os.popen(cmd).read().strip()
+    return os.path.join(self.images_dir, board, 'latest')
 
   def GetDefaultBoardID(self):
     """Returns the default board id stored in .default_board.