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

Unified Diff: chrome/common/extensions/docs/server2/file_system.py

Issue 165353004: Docserver: Fix invalid path usage in CloudStorageFileSystem. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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: chrome/common/extensions/docs/server2/file_system.py
diff --git a/chrome/common/extensions/docs/server2/file_system.py b/chrome/common/extensions/docs/server2/file_system.py
index 1caf1dd1b565786d47c4aefda13f8fa8e2626bcf..c2da419e9ed2e40c31d10cf54ff36e9db6892faf 100644
--- a/chrome/common/extensions/docs/server2/file_system.py
+++ b/chrome/common/extensions/docs/server2/file_system.py
@@ -6,7 +6,9 @@ import posixpath
import traceback
from future import Gettable, Future
-from path_util import AssertIsDirectory, AssertIsValid, SplitParent, ToDirectory
+from path_util import (
+ AssertIsDirectory, AssertIsValid, IsDirectory, IsValid, SplitParent,
+ ToDirectory)
class _BaseFileSystemException(Exception):
@@ -39,6 +41,9 @@ class StatInfo(object):
'''The result of calling Stat on a FileSystem.
'''
def __init__(self, version, child_versions=None):
+ if child_versions:
+ assert all(IsValid(path) for path in child_versions.iterkeys()), \
+ child_versions
self.version = version
self.child_versions = child_versions
@@ -152,7 +157,7 @@ class FileSystem(object):
dirs, files = [], []
for f in self.ReadSingle(root).Get():
- if f.endswith('/'):
+ if IsDirectory(f):
dirs.append(f)
else:
files.append(f)
« no previous file with comments | « chrome/common/extensions/docs/server2/cron.yaml ('k') | chrome/common/extensions/docs/server2/gcs_file_system.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698