f"http://{ip.addr}:{ip.port}",
f'Key "/management/interface" in "{config}" file',
)
- return None
except ValueError as e:
raise DataValidationError(*e.args) from e # pylint: disable=no-value-for-parameter
- except OSError as e:
+ except OSError:
if not optional_file:
- raise e
+ raise
+ return None
+ else:
return None
if self.type is SubprocessType.KRESD:
register_worker(self)
self._registered_worker = True
- except KresSubprocessControllerError as e:
+ except KresSubprocessControllerError:
self._unlink_config()
- raise e
+ raise
async def apply_new_config(self, new_config: KresConfig) -> None:
self._config = new_config
raise errs[0]
if len(errs) > 1:
raise AggregateDataValidationError(object_path, child_exceptions=errs)
- return res
except AttributeError as e:
raise DataValidationError(
f"Expected dict-like object, but failed to access its .items() method. Value was {obj}", object_path
) from e
+ else:
+ return res
def _create_list(self, tp: Type[Any], obj: List[Any], object_path: str) -> List[Any]:
if isinstance(obj, str):
"""Runtime type checking. Validate, that a given object is of a given type."""
try:
self.map_object(tp, obj)
- return True
except (DataValidationError, ValueError):
return False
+ else:
+ return True
def _assign_default(self, obj: Any, name: str, python_type: Any, object_path: str) -> None:
cls = obj.__class__