Commit 48660864 authored by achuith@chromium.org's avatar achuith@chromium.org

Raise an error if cryptohome-path fails.

BUG=375717
TEST=trybot, manual
NOTRY=True

Review URL: https://codereview.chromium.org/297823002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@272028 0039d316-1c4b-4281-b951-d872f2087c98
parent 9a48e3f8
...@@ -48,8 +48,8 @@ class CrOSBrowserBackend(chrome_browser_backend.ChromeBrowserBackend): ...@@ -48,8 +48,8 @@ class CrOSBrowserBackend(chrome_browser_backend.ChromeBrowserBackend):
# Note that we also perform this copy locally to ensure that # Note that we also perform this copy locally to ensure that
# the owner of the extensions is set to chronos. # the owner of the extensions is set to chronos.
for e in extensions_to_load: for e in extensions_to_load:
output = cri.RunCmdOnDevice(['mktemp', '-d', '/tmp/extension_XXXXX']) extension_dir = cri.RunCmdOnDevice(
extension_dir = output[0].rstrip() ['mktemp', '-d', '/tmp/extension_XXXXX'])[0].rstrip()
cri.PushFile(e.path, extension_dir) cri.PushFile(e.path, extension_dir)
cri.Chown(extension_dir) cri.Chown(extension_dir)
e.local_path = os.path.join(extension_dir, os.path.basename(e.path)) e.local_path = os.path.join(extension_dir, os.path.basename(e.path))
......
...@@ -196,7 +196,7 @@ class CrOSInterface(object): ...@@ -196,7 +196,7 @@ class CrOSInterface(object):
if "Connection timed out" in stderr: if "Connection timed out" in stderr:
raise OSError('Machine wasn\'t responding to ssh: %s' % raise OSError('Machine wasn\'t responding to ssh: %s' %
stderr) stderr)
raise OSError('Unepected error: %s' % stderr) raise OSError('Unexpected error: %s' % stderr)
exists = stdout == '1\n' exists = stdout == '1\n'
logging.debug("FileExistsOnDevice(<text>, %s)->%s" % (file_name, exists)) logging.debug("FileExistsOnDevice(<text>, %s)->%s" % (file_name, exists))
return exists return exists
...@@ -401,8 +401,11 @@ class CrOSInterface(object): ...@@ -401,8 +401,11 @@ class CrOSInterface(object):
def CryptohomePath(self, user): def CryptohomePath(self, user):
"""Returns the cryptohome mount point for |user|.""" """Returns the cryptohome mount point for |user|."""
return self.RunCmdOnDevice( stdout, stderr = self.RunCmdOnDevice(
['cryptohome-path', 'user', "'%s'" % user])[0].strip() ['cryptohome-path', 'user', "'%s'" % user])
if stderr != '':
raise OSError('cryptohome-path failed: %s' % stderr)
return stdout.rstrip()
def IsCryptohomeMounted(self, username, is_guest): def IsCryptohomeMounted(self, username, is_guest):
"""Returns True iff |user|'s cryptohome is mounted.""" """Returns True iff |user|'s cryptohome is mounted."""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment