From 2c03b8994c3ee37e5ca241b88e04ad708d7adeee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20=C5=98ezn=C3=AD=C4=8Dek?= <246254@mail.muni.cz> Date: Fri, 31 May 2024 10:33:21 +0200 Subject: [PATCH] feat: assert disabled projects to avoid nova API 401s as listed below: --- CHANGELOG.md | 4 ++++ ci/project-migrator.py | 12 +++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d76bd4..191e739 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.1.3] - 2024-05-31 +### Fixed +- assert disabled projects + ## [1.1.2] - 2024-05-30 ### Fixed - attach FIP to correct virtual NIC diff --git a/ci/project-migrator.py b/ci/project-migrator.py index 52caacd..464fc67 100755 --- a/ci/project-migrator.py +++ b/ci/project-migrator.py @@ -54,20 +54,22 @@ def main(args): source_project = lib.get_ostack_project(source_migrator_conn, source_project_name) lib.log_or_assert(args, f"B.01 Source OpenStack cloud project (name:{source_project_name}) exists", source_project) source_project_type = lib.get_ostack_project_type(source_migrator_conn, source_project) - lib.log_or_assert(args, f"B.02 Source OpenStack cloud project type is {source_project_type}", - source_project_type) + lib.log_or_assert(args, "B.02 Source OpenStack cloud project is enabled", source_project.is_enabled) + lib.log_or_assert(args, f"B.03 Source OpenStack cloud project type is {source_project_type}", + source_project_type) destination_project = lib.get_ostack_project(destination_migrator_conn, destination_project_name) lib.log_or_assert(args, f"B.10 Destination OpenStack cloud project (name:{destination_project_name}) exists", destination_project) + lib.log_or_assert(args, "B.11 Destination OpenStack cloud project is enabled", destination_project.is_enabled) destination_project_type = lib.get_ostack_project_type(destination_migrator_conn, destination_project) - lib.log_or_assert(args, f"B.11 Destination OpenStack cloud project type is {destination_project_type}", + lib.log_or_assert(args, f"B.12 Destination OpenStack cloud project type is {destination_project_type}", destination_project_type) - lib.log_or_assert(args, "B.12 Source and destination project types match", + lib.log_or_assert(args, "B.13 Source and destination project types match", source_project_type == destination_project_type) if destination_project_type == 'group' and lib.executed_in_ci(): lib.log_or_assert(args, - "B.13 Cloud group project migration is executed by authorized person (cloud/openstack team member).", + "B.14 Cloud group project migration is executed by authorized person (cloud/openstack team member).", lib.executed_as_admin_user_in_ci()) -- GitLab