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

Unified Diff: devil/devil/android/device_utils.py

Issue 1860663002: [devil] Set cache token only after successful initialization. (Closed) Base URL: git@github.com:catapult-project/catapult.git@master
Patch Set: +tests Created 4 years, 8 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
« no previous file with comments | « no previous file | devil/devil/android/device_utils_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: devil/devil/android/device_utils.py
diff --git a/devil/devil/android/device_utils.py b/devil/devil/android/device_utils.py
index 57c3f81c48c30fde6e46ed56812c249cc979c660..360bb54bf01d418c4eedc318d22d3062cd4bef43 100644
--- a/devil/devil/android/device_utils.py
+++ b/devil/devil/android/device_utils.py
@@ -1755,12 +1755,12 @@ class DeviceUtils(object):
return
# Change the token every time to ensure that it will match only the
# previously dumped cache.
- self._cache['token'] = str(uuid.uuid1())
+ token = str(uuid.uuid1())
cmd = (
'c=/data/local/tmp/cache_token;'
'echo $EXTERNAL_STORAGE;'
'cat $c 2>/dev/null||echo;'
- 'echo "%s">$c &&' % self._cache['token'] +
+ 'echo "%s">$c &&' % token +
'getprop'
)
output = self.RunShellCommand(cmd, check_return=True, large_output=True)
@@ -1773,6 +1773,7 @@ class DeviceUtils(object):
prop_cache.clear()
for key, value in _GETPROP_RE.findall(''.join(output)):
prop_cache[key] = value
+ self._cache['token'] = token
@decorators.WithTimeoutAndRetriesFromInstance()
def GetProp(self, property_name, cache=False, timeout=None, retries=None):
« no previous file with comments | « no previous file | devil/devil/android/device_utils_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698