gs: change LS to return structured results by default
Rather than require people to parse the raw gsutil output themselves,
handle that and return structured results. The point of the gs module
is to hide all of these warts from the caller.
For now we only support plain file listings. We'll want to expand this
though to also handle the -l and -a formats.
If someone wants to do something crazy, they can leverage the new raw
option to get at the full output.
BUG=chromium:342918
TEST=`./buildbot/run_tests` passes
Change-Id: I19ec390d86895e3b6f1ca2c04e889f7019d57dd1
Reviewed-on: https://chromium-review.googlesource.com/185853
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
diff --git a/scripts/deploy_chrome.py b/scripts/deploy_chrome.py
index 2623cb5..d18aa81 100644
--- a/scripts/deploy_chrome.py
+++ b/scripts/deploy_chrome.py
@@ -576,7 +576,7 @@
Path to the fetched chrome tarball.
"""
gs_ctx = gs.GSContext(cache_dir=cache_dir, init_boto=True)
- files = gs_ctx.LS(gs_path).output.splitlines()
+ files = gs_ctx.LS(gs_path)
files = [found for found in files if
_UrlBaseName(found).startswith('%s-' % constants.CHROME_PN)]
if not files: