Fix CI: Raise specific exception.

Do comparison with !=.
This commit is contained in:
erik 2023-04-19 11:57:26 +02:00
parent 0a85790410
commit c530628192

View file

@ -23,7 +23,7 @@ class ReleaseMixin(DevopsBuild):
def __init__(self, project: Project, config: Optional[dict] = None, release_config: Optional[ReleaseConfig] = None): def __init__(self, project: Project, config: Optional[dict] = None, release_config: Optional[ReleaseConfig] = None):
if not release_config: if not release_config:
if not config: if not config:
raise Exception("Release parameters could not be set.") raise ValueError("Release parameters could not be set.")
super().__init__(project, config=config) super().__init__(project, config=config)
release_mixin_config = config['ReleaseMixin'] release_mixin_config = config['ReleaseMixin']
release_config = ReleaseConfig( release_config = ReleaseConfig(
@ -38,7 +38,7 @@ class ReleaseMixin(DevopsBuild):
git_api = GitApi() git_api = GitApi()
environment_api = EnvironmentApi() environment_api = EnvironmentApi()
env_key = EnvironmentKeys.DDADEVOPS_RELEASE_TYPE.name env_key = EnvironmentKeys.DDADEVOPS_RELEASE_TYPE.name
environment_val_set = environment_api.get(env_key) is not "" and environment_api.get(env_key) is not None environment_val_set = environment_api.get(env_key) != "" and environment_api.get(env_key) is not None
if environment_val_set: if environment_val_set:
release_type_repo = ReleaseTypeRepository.from_environment(environment_api) release_type_repo = ReleaseTypeRepository.from_environment(environment_api)