Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Unified Diff: client/isolated_format.py

Issue 2060983006: luci-py/isolateserver.py: Add archive support when downloading. (Closed) Base URL: https://github.com/luci/luci-py.git@master
Patch Set: Update hashes as version has changed. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: client/isolated_format.py
diff --git a/client/isolated_format.py b/client/isolated_format.py
index a71dbc07a839e76152db65ce5297ca302f8ede62..c828f74ada436ea1ef0e70c49b8c3f53bd45f213 100644
--- a/client/isolated_format.py
+++ b/client/isolated_format.py
@@ -18,7 +18,7 @@ from utils import tools
# Version stored and expected in .isolated files.
-ISOLATED_FILE_VERSION = '1.4'
+ISOLATED_FILE_VERSION = '1.5'
# Chunk size to use when doing disk I/O.
@@ -37,6 +37,8 @@ SUPPORTED_ALGOS = {
# Used for serialization.
SUPPORTED_ALGOS_REVERSE = dict((v, k) for k, v in SUPPORTED_ALGOS.iteritems())
+SUPPORTED_FILE_TYPES = ['basic', 'ar']
+
class IsolatedError(ValueError):
"""Generic failure to load a .isolated file."""
@@ -506,6 +508,10 @@ def load_isolated(content, algo):
elif subsubkey == 's':
if not isinstance(subsubvalue, (int, long)):
raise IsolatedError('Expected int or long, got %r' % subsubvalue)
+ elif subsubkey == 't':
+ if subsubvalue not in SUPPORTED_FILE_TYPES:
+ raise IsolatedError('Expected one of \'%s\', got %r' % (
+ ', '.join(sorted(SUPPORTED_FILE_TYPES)), subsubvalue))
else:
raise IsolatedError('Unknown subsubkey %s' % subsubkey)
if bool('h' in subvalue) == bool('l' in subvalue):

Powered by Google App Engine
This is Rietveld 408576698