Don't require cwd when path is absolute.
This commit is contained in:
parent
ce3e477c4c
commit
02aa737241
1 changed files with 2 additions and 0 deletions
|
@ -185,6 +185,8 @@ class SchrootSession(Session):
|
|||
self.check_call(["chown", user, home], cwd="/", user="root")
|
||||
|
||||
def external_path(self, path: str) -> str:
|
||||
if os.path.isabs(path):
|
||||
return os.path.join(self.location, path.lstrip("/"))
|
||||
if self._cwd is None:
|
||||
raise ValueError("no cwd set")
|
||||
return os.path.join(self.location, os.path.join(self._cwd, path).lstrip("/"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue