-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed embedded git repo, addressed review commentary
- Loading branch information
Showing
41 changed files
with
629 additions
and
2,137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +0,0 @@ | ||
"""pkgutil-style namespace package.""" | ||
|
||
import pkgutil | ||
|
||
__path__ = pkgutil.extend_path(__path__, __name__) | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
"""Exceptions for the LabRunner startup service.""" | ||
|
||
from __future__ import annotations | ||
|
||
import subprocess | ||
from collections.abc import Iterable | ||
from shlex import join | ||
|
||
__all__ = [ | ||
"CommandFailedError", | ||
"CommandTimedOutError", | ||
] | ||
|
||
|
||
class CommandFailedError(Exception): | ||
"""Execution of a command failed. | ||
Parameters | ||
---------- | ||
args | ||
Command (args[0]) and arguments to that command. | ||
exc | ||
Exception reporting the failure. | ||
Attributes | ||
---------- | ||
stdout | ||
Standard output from the failed command. | ||
stderr | ||
Standard error from the failed command. | ||
""" | ||
|
||
def __init__( | ||
self, | ||
args: Iterable[str], | ||
exc: subprocess.CalledProcessError, | ||
) -> None: | ||
args_str = join(args) | ||
msg = f"'{args_str}' failed with status {exc.returncode}" | ||
super().__init__(msg) | ||
self.stdout = exc.stdout | ||
self.stderr = exc.stderr | ||
|
||
|
||
class CommandTimedOutError(Exception): | ||
"""Execution of a command failed. | ||
Parameters | ||
---------- | ||
args | ||
Command (args[0]) and arguments to that command. | ||
exc | ||
Exception reporting the failure. | ||
Attributes | ||
---------- | ||
stdout | ||
Standard output from the failed command. | ||
stderr | ||
Standard error from the failed command. | ||
""" | ||
|
||
def __init__( | ||
self, | ||
args: Iterable[str], | ||
exc: subprocess.TimeoutExpired, | ||
) -> None: | ||
args_str = join(args) | ||
msg = f"'{args_str}' timed out after {exc.timeout}s" | ||
super().__init__(msg) | ||
self.stdout = exc.stdout | ||
self.stderr = exc.stderr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.