Use static_dir flag to set the devserver directory
Deprecate static/archive from devserver; only serve from the static
folder.
Deprecate --data_dir flag and replace with --static_dir.
Tag archive_dir for deprecation.
BUG=chromium:214373
TEST=unittests
TEST=cbuildbot --remote on mario-paladin and lumpy-release with CL60101
Change-Id: I17294138f7ccd2a8e44a25de9ee56ad1ebf3e023
Reviewed-on: https://gerrit.chromium.org/gerrit/59790
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: Chris Sosa <sosa@chromium.org>
Commit-Queue: Chris Sosa <sosa@chromium.org>
diff --git a/autoupdate.py b/autoupdate.py
index 4a88659..b74f343 100644
--- a/autoupdate.py
+++ b/autoupdate.py
@@ -145,6 +145,7 @@
host_log: record full history of host update events.
"""
+ _OLD_PAYLOAD_URL_PREFIX = '/static/archive'
_PAYLOAD_URL_PREFIX = '/static/'
_FILEINFO_URL_PREFIX = '/api/fileinfo/'
@@ -555,8 +556,13 @@
'Payload URL does not have the expected prefix (%s)' %
self._PAYLOAD_URL_PREFIX)
- fileinfo_url = url.replace(self._PAYLOAD_URL_PREFIX,
- self._FILEINFO_URL_PREFIX)
+ if self._OLD_PAYLOAD_URL_PREFIX in url:
+ fileinfo_url = url.replace(self._OLD_PAYLOAD_URL_PREFIX,
+ self._FILEINFO_URL_PREFIX)
+ else:
+ fileinfo_url = url.replace(self._PAYLOAD_URL_PREFIX,
+ self._FILEINFO_URL_PREFIX)
+
_Log('Retrieving file info for remote payload via %s', fileinfo_url)
try:
conn = urllib2.urlopen(fileinfo_url)
@@ -654,8 +660,6 @@
if self.urlbase:
static_urlbase = self.urlbase
- elif self.serve_only:
- static_urlbase = '%s/static/archive' % hostname
else:
static_urlbase = '%s/static' % hostname