From b84218a42109bdf7a5b390b2db96926e28c592d1 Mon Sep 17 00:00:00 2001 From: Jim MacArthur Date: Mon, 4 Jun 2018 12:44:14 +0100 Subject: _filebaseddirectory/directory.py: Move VirtualDirectoryError to Directory --- buildstream/storage/_filebaseddirectory.py | 17 ++--------------- buildstream/storage/directory.py | 13 +++++++++++++ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/buildstream/storage/_filebaseddirectory.py b/buildstream/storage/_filebaseddirectory.py index 8f88adc84..17144bc5f 100644 --- a/buildstream/storage/_filebaseddirectory.py +++ b/buildstream/storage/_filebaseddirectory.py @@ -29,25 +29,12 @@ See also: :ref:`sandboxing`. import os import time -from .._exceptions import BstError, ErrorDomain -from .directory import Directory +from .directory import Directory, VirtualDirectoryError from ..utils import link_files, copy_files, list_relative_paths, _get_link_mtime, _magic_timestamp from ..utils import _set_deterministic_user, _set_deterministic_mtime - -class VirtualDirectoryError(BstError): - """Raised by Directory functions when system calls fail. - This will be handled internally by the BuildStream core, - if you need to handle this error, then it should be reraised, - or either of the :class:`.ElementError` or :class:`.SourceError` - exceptions should be raised from this error. - """ - def __init__(self, message, reason=None): - super().__init__(message, domain=ErrorDomain.VIRTUAL_FS, reason=reason) - - # FileBasedDirectory intentionally doesn't call its superclass constuctor, -# which is mean to be unimplemented. +# which is meant to be unimplemented. # pylint: disable=super-init-not-called diff --git a/buildstream/storage/directory.py b/buildstream/storage/directory.py index 40a895acc..984a7f0dd 100644 --- a/buildstream/storage/directory.py +++ b/buildstream/storage/directory.py @@ -31,6 +31,19 @@ See also: :ref:`sandboxing`. """ +from .._exceptions import BstError, ErrorDomain + + +class VirtualDirectoryError(BstError): + """Raised by Directory functions when system calls fail. + This will be handled internally by the BuildStream core, + if you need to handle this error, then it should be reraised, + or either of the :class:`.ElementError` or :class:`.SourceError` + exceptions should be raised from this error. + """ + def __init__(self, message, reason=None): + super().__init__(message, domain=ErrorDomain.VIRTUAL_FS, reason=reason) + class Directory(): def __init__(self, external_directory=None): -- cgit v1.2.1