Skip to content

Commit

Permalink
fix the ci python version errors
Browse files Browse the repository at this point in the history
  • Loading branch information
vijaykanthm committed Dec 19, 2024
1 parent 382b52d commit 9d7658e
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@

import backoff

from google.api_core.exceptions import InternalServerError, NotFound, ServiceUnavailable

import random

from google.cloud import securitycentermanagement_v1
from google.api_core.exceptions import InternalServerError, NotFound, ServiceUnavailable

import time

from google.cloud import securitycentermanagement_v1

import pytest

import security_health_analytics_custom_modules
Expand Down Expand Up @@ -54,7 +54,8 @@ def cleanup_existing_custom_modules(org_id: str):
"""
client = securitycentermanagement_v1.SecurityCenterManagementClient()
parent = f"organizations/{org_id}/locations/global"

print(f"Parent path: {parent}")

try:
custom_modules = client.list_security_health_analytics_custom_modules(
request={"parent": parent}
Expand All @@ -65,8 +66,11 @@ def cleanup_existing_custom_modules(org_id: str):
request={"name": module.name}
)
print(f"Deleted custom module: {module.name}")
except NotFound:
print(f"Custom Module not found for deletion: {module.name}")
except NotFound as e:
print(f"Resource not found: {e}")
except Exception as e:
print(f"Unexpected error during cleanup: {e}")
raise


def add_custom_module(org_id: str):
Expand Down

0 comments on commit 9d7658e

Please sign in to comment.