diff options
author | Jim MacArthur <jim.macarthur@codethink.co.uk> | 2018-06-04 12:44:14 +0100 |
---|---|---|
committer | Jim MacArthur <jim.macarthur@codethink.co.uk> | 2018-08-15 15:33:05 +0100 |
commit | b84218a42109bdf7a5b390b2db96926e28c592d1 (patch) | |
tree | d7364fef9855a626229ec02745f94a3833203b4b | |
parent | 88ccff6e811320e3e77510db5179c570e6ec0995 (diff) | |
download | buildstream-b84218a42109bdf7a5b390b2db96926e28c592d1.tar.gz |
_filebaseddirectory/directory.py: Move VirtualDirectoryError to Directory
-rw-r--r-- | buildstream/storage/_filebaseddirectory.py | 17 | ||||
-rw-r--r-- | 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): |