Set is_temporary.

This commit is contained in:
Jelmer Vernooij 2021-03-24 20:36:17 +00:00
parent ef1d684b65
commit 3e41558f91
3 changed files with 6 additions and 0 deletions

View file

@ -100,6 +100,8 @@ class Session(object):
def external_path(self, path: str) -> str: def external_path(self, path: str) -> str:
raise NotImplementedError raise NotImplementedError
is_temporary: bool
class SessionSetupFailure(Exception): class SessionSetupFailure(Exception):
"""Session failed to be set up.""" """Session failed to be set up."""

View file

@ -112,3 +112,5 @@ class PlainSession(Session):
def setup_from_directory(self, path): def setup_from_directory(self, path):
return path, path return path, path
is_temporary = False

View file

@ -215,3 +215,5 @@ class SchrootSession(Session):
export_directory = os.path.join(directory, subdir) export_directory = os.path.join(directory, subdir)
shutil.copytree(path, export_directory, dirs_exist_ok=True) shutil.copytree(path, export_directory, dirs_exist_ok=True)
return export_directory, os.path.join(reldir, subdir) return export_directory, os.path.join(reldir, subdir)
is_temporary = True