fix openstack cleanup (#11410)

Signed-off-by: Kay Yan <kay.yan@daocloud.io>
Co-authored-by: Kay Yan <kay.yan@daocloud.io>
pull/11438/head
k8s-infra-cherrypick-robot 2024-08-09 02:21:44 -07:00 committed by GitHub
parent 76d07e901f
commit bd80766aca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 3 deletions

View File

@ -79,7 +79,7 @@ ci-not-authorized:
after_script: [] after_script: []
rules: rules:
# LGTM or ok-to-test labels # LGTM or ok-to-test labels
- if: $PR_LABELS =~ /.*,(lgtm|ok-to-test).*|^(lgtm|ok-to-test).*/i - if: $PR_LABELS =~ /.*,(lgtm|approved|ok-to-test).*|^(lgtm|approved|ok-to-test).*/i
variables: variables:
CI_OK_TO_TEST: '0' CI_OK_TO_TEST: '0'
when: always when: always

View File

@ -38,6 +38,13 @@ def main():
conn.compute.servers()) conn.compute.servers())
print('Security groups...') print('Security groups...')
try:
map_if_old(conn.network.delete_security_group,
conn.network.security_groups())
except openstack.exceptions.ConflictException as ex:
# Need to delete port when security groups is in used
map_if_old(conn.network.delete_port,
conn.network.ports())
map_if_old(conn.network.delete_security_group, map_if_old(conn.network.delete_security_group,
conn.network.security_groups()) conn.network.security_groups())