Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion glazier/autobuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class BatteryStatusError(Error):

def __init__(self):
super().__init__(
error_code=errors.ErrorCode.BATTERY_STATUS_ERROR,
error_code=errors.ErrorCode.BATTERY_STATUS_ERROR, # pyrefly: ignore[missing-attribute]
message=StripMargin('Imaging process started while on battery'),
)

Expand Down
2 changes: 1 addition & 1 deletion glazier/lib/actions/art.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class FileNotFound(Error):

def __init__(self, path: str):
super().__init__(
error_code=errors.ErrorCode.FILE_NOT_FOUND,
error_code=errors.ErrorCode.FILE_NOT_FOUND, # pyrefly: ignore[missing-attribute]
message=f'The following path does not exist: {path}')


Expand Down
4 changes: 2 additions & 2 deletions glazier/lib/actions/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def __init__(self, message: Optional[str] = None):
message = 'Error encountered while executing action'

super().__init__(
error_code=errors.ErrorCode.ACTION_ERROR,
error_code=errors.ErrorCode.ACTION_ERROR, # pyrefly: ignore[missing-attribute]
message=message)


Expand All @@ -38,7 +38,7 @@ class ValidationError(errors.GlazierError):

def __init__(self, message: str):
super().__init__(
error_code=errors.ErrorCode.VALIDATION_ERROR,
error_code=errors.ErrorCode.VALIDATION_ERROR, # pyrefly: ignore[missing-attribute]
message=message)


Expand Down
2 changes: 1 addition & 1 deletion glazier/lib/actions/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def _Run(self, command: str, success_codes: List[int],
raise ActionError() from e

try:
command_list = shlex.split(command_cache, posix=False)
command_list = shlex.split(command_cache, posix=False) # pyrefly: ignore[bad-argument-type]
result = execute.execute_binary(
command_list[0],
command_list[1:],
Expand Down
2 changes: 1 addition & 1 deletion glazier/lib/actions/googet.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def Run(self):
pkg=args[0],
retries=retries,
sleep=sleep,
remove=remove,
remove=remove, # pyrefly: ignore[bad-argument-type]
build_info=self._build_info,
path=path,
flags=flags
Expand Down
10 changes: 5 additions & 5 deletions glazier/lib/beyondcorp.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ def __init__(self, tries: int, elapsed: float):
'Do you have a valid network configuration?'
)
super().__init__(
error_code=errors.ErrorCode.BEYONDCORP_GIVE_UP,
error_code=errors.ErrorCode.BEYONDCORP_GIVE_UP, # pyrefly: ignore[missing-attribute]
message=message)


class BeyondCorpSeedFileError(Error):

def __init__(self, file_path: str):
super().__init__(
error_code=errors.ErrorCode.BEYONDCORP_SEED_FILE_MISSING,
error_code=errors.ErrorCode.BEYONDCORP_SEED_FILE_MISSING, # pyrefly: ignore[missing-attribute]
message=f'BeyondCorp seed file not found: {file_path}',
)

Expand All @@ -82,15 +82,15 @@ class BeyondCorpDriveLetterError(Error):

def __init__(self, message: str):
super().__init__(
error_code=errors.ErrorCode.BEYONDCORP_DRIVE_LETTER_ERROR,
error_code=errors.ErrorCode.BEYONDCORP_DRIVE_LETTER_ERROR, # pyrefly: ignore[missing-attribute]
message=message)


class BeyondCorpSignedUrlRequestError(Error):

def __init__(self, message: str):
super().__init__(
error_code=errors.ErrorCode.BEYONDCORP_REQUEST_ERROR,
error_code=errors.ErrorCode.BEYONDCORP_REQUEST_ERROR, # pyrefly: ignore[missing-attribute]
message=message)


Expand All @@ -102,7 +102,7 @@ def __init__(self, status_code: str, status: str):
f'Status Code: {status_code}, Status: {status}'
)
super().__init__(
error_code=errors.ErrorCode.BEYONDCORP_RESPONSE_ERROR,
error_code=errors.ErrorCode.BEYONDCORP_RESPONSE_ERROR, # pyrefly: ignore[missing-attribute]
message=message)


Expand Down
6 changes: 3 additions & 3 deletions glazier/lib/bitlocker.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,23 @@ class BitlockerEnableTpmError(Error):

def __init__(self):
super().__init__(
error_code=errors.ErrorCode.BITLOCKER_ENABLE_TPM_FAILED,
error_code=errors.ErrorCode.BITLOCKER_ENABLE_TPM_FAILED, # pyrefly: ignore[missing-attribute]
message='Error while enabling TPM via Powershell')


class BitlockerActivationFailedError(Error):

def __init__(self):
super().__init__(
error_code=errors.ErrorCode.BITLOCKER_ACTIVATION_FAILED,
error_code=errors.ErrorCode.BITLOCKER_ACTIVATION_FAILED, # pyrefly: ignore[missing-attribute]
message='Bitlocker activation failed')


class BitlockerUnknownModeError(Error):

def __init__(self, mode: str):
super().__init__(
error_code=errors.ErrorCode.BITLOCKER_UNKNOWN_MODE,
error_code=errors.ErrorCode.BITLOCKER_UNKNOWN_MODE, # pyrefly: ignore[missing-attribute]
message=f'Unknown mode: {mode}')


Expand Down
12 changes: 6 additions & 6 deletions glazier/lib/buildinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,47 +46,47 @@ class IllegalPinError(Error):

def __init__(self, pin_name: str):
super().__init__(
error_code=errors.ErrorCode.ILLEGAL_PIN,
error_code=errors.ErrorCode.ILLEGAL_PIN, # pyrefly: ignore[missing-attribute]
message=f'Referencing illegal pin name: {pin_name}')


class YamlFileError(Error):

def __init__(self, path: str):
super().__init__(
error_code=errors.ErrorCode.YAML_FILE_ERROR,
error_code=errors.ErrorCode.YAML_FILE_ERROR, # pyrefly: ignore[missing-attribute]
message=f'Error reading YAML file: {path}')


class WMIError(Error):

def __init__(self, message: str):
super().__init__(
error_code=errors.ErrorCode.WMI_ERROR,
error_code=errors.ErrorCode.WMI_ERROR, # pyrefly: ignore[missing-attribute]
message=message)


class UnknownOsCodeError(Error):

def __init__(self, os: str):
super().__init__(
error_code=errors.ErrorCode.UNKNOWN_OS_CODE,
error_code=errors.ErrorCode.UNKNOWN_OS_CODE, # pyrefly: ignore[missing-attribute]
message=f'Unknown OS code: {os}')


class UndeterminedHostOsError(Error):

def __init__(self):
super().__init__(
error_code=errors.ErrorCode.UNDETERMINED_HOST_OS,
error_code=errors.ErrorCode.UNDETERMINED_HOST_OS, # pyrefly: ignore[missing-attribute]
message='Unable to determine host OS.')


class UnsupportedReleaseVersionError(Error):

def __init__(self, os: str):
super().__init__(
error_code=errors.ErrorCode.UNSUPPORTED_RELEASE_VERSION,
error_code=errors.ErrorCode.UNSUPPORTED_RELEASE_VERSION, # pyrefly: ignore[missing-attribute]
message=f'Unable to find a release that supports {os}.')


Expand Down
2 changes: 1 addition & 1 deletion glazier/lib/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class CacheError(Error):

def __init__(self, file_path: str):
super().__init__(
error_code=errors.ErrorCode.CACHE_MISS,
error_code=errors.ErrorCode.CACHE_MISS, # pyrefly: ignore[missing-attribute]
message=f'Unable to download required file: {file_path}')


Expand Down
2 changes: 1 addition & 1 deletion glazier/lib/config/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ConfigError(Error):

def __init__(self, message: str):
super().__init__(
error_code=errors.ErrorCode.CONFIG_ERROR,
error_code=errors.ErrorCode.CONFIG_ERROR, # pyrefly: ignore[missing-attribute]
message=message)


Expand Down
6 changes: 3 additions & 3 deletions glazier/lib/config/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,23 +70,23 @@ class ConfigBuilderError(Error):

def __init__(self):
super().__init__(
error_code=errors.ErrorCode.FAILED_TASK_LIST_BUILD,
error_code=errors.ErrorCode.FAILED_TASK_LIST_BUILD, # pyrefly: ignore[missing-attribute]
message='Failed to build the task list')


class SysInfoError(Error):

def __init__(self):
super().__init__(
error_code=errors.ErrorCode.SYS_INFO,
error_code=errors.ErrorCode.SYS_INFO, # pyrefly: ignore[missing-attribute]
message='Error gathering system information')


class UnknownActionError(Error):

def __init__(self, action: str):
super().__init__(
error_code=errors.ErrorCode.UNKNOWN_ACTION,
error_code=errors.ErrorCode.UNKNOWN_ACTION, # pyrefly: ignore[missing-attribute]
message=f'Unknown imaging action [{action}]')


Expand Down
10 changes: 5 additions & 5 deletions glazier/lib/config/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,39 +31,39 @@ class FileMoveError(Error):

def __init__(self, src: str, dest: str):
super().__init__(
error_code=errors.ErrorCode.FILE_MOVE_ERROR,
error_code=errors.ErrorCode.FILE_MOVE_ERROR, # pyrefly: ignore[missing-attribute]
message=f'Failed to move file from {src} to {dest}')


class FileRemoveError(Error):

def __init__(self, path: str):
super().__init__(
error_code=errors.ErrorCode.FILE_REMOVE_ERROR,
error_code=errors.ErrorCode.FILE_REMOVE_ERROR, # pyrefly: ignore[missing-attribute]
message=f'Failed to remove file: {path}')


class FileWriteError(Error):

def __init__(self, path: str):
super().__init__(
error_code=errors.ErrorCode.FILE_WRITE_ERROR,
error_code=errors.ErrorCode.FILE_WRITE_ERROR, # pyrefly: ignore[missing-attribute]
message=f'Failed to write file: {path}')


class FileReadError(Error):

def __init__(self, path: str):
super().__init__(
error_code=errors.ErrorCode.FILE_READ_ERROR,
error_code=errors.ErrorCode.FILE_READ_ERROR, # pyrefly: ignore[missing-attribute]
message=f'Failed to read file: {path}')


class FileDownloadError(Error):

def __init__(self, url: str):
super().__init__(
error_code=errors.ErrorCode.FILE_DOWNLOAD_ERROR,
error_code=errors.ErrorCode.FILE_DOWNLOAD_ERROR, # pyrefly: ignore[missing-attribute]
message=f'Could not download file: {url}')


Expand Down
4 changes: 2 additions & 2 deletions glazier/lib/config/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ class ConfigRunnerError(Error):

def __init__(self):
super().__init__(
error_code=errors.ErrorCode.FAILED_TASK_LIST_RUN,
error_code=errors.ErrorCode.FAILED_TASK_LIST_RUN, # pyrefly: ignore[missing-attribute]
message='Failed to execute the task list')


class UnknownPolicyError(Error):

def __init__(self, policy: str):
super().__init__(
error_code=errors.ErrorCode.UNKNOWN_POLICY,
error_code=errors.ErrorCode.UNKNOWN_POLICY, # pyrefly: ignore[missing-attribute]
message=f'Unknown imaging policy [{policy}]')


Expand Down
4 changes: 2 additions & 2 deletions glazier/lib/domain_join.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class DomainJoinError(Error):

def __init__(self, message: str):
super().__init__(
error_code=errors.ErrorCode.DOMAIN_JOIN_FAILURE,
error_code=errors.ErrorCode.DOMAIN_JOIN_FAILURE, # pyrefly: ignore[missing-attribute]
message=message)


Expand Down Expand Up @@ -125,7 +125,7 @@ def _InteractiveJoin(self):
cmd += ['-OUPath', f'"{self._domain_ou}"']
try:
logging.debug('Attempting to join the domain %s.', self._domain_name)
ps.RunCommand(cmd)
ps.RunCommand(cmd) # pyrefly: ignore[bad-argument-type]
except powershell.Error as e:
logging.error(
'Domain join failed. Sleeping 5 minutes then trying again. (%s)', e)
Expand Down
Loading
Loading