Skip to content

Commit 382b52d

Browse files
committed
fix lint errors
1 parent 3b2b41c commit 382b52d

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

securitycenter/snippets_management_api/noxfile_config.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@
2323
TEST_CONFIG_OVERRIDE = {
2424
# You can opt out from the test for specific Python versions.
2525
"ignored_versions": ["2.7", "3.7", "3.9", "3.10", "3.11"],
26-
# Old samples are opted out of enforcing Python type hints
27-
# All new samples should feature them
28-
"enforce_type_hints": True,
2926
# An envvar key for determining the project id to use. Change it
3027
# to 'BUILD_SPECIFIC_GCLOUD_PROJECT' if you want to opt in using a
3128
# build specific Cloud project. You can also use your own string

securitycenter/snippets_management_api/security_health_analytics_custom_module_test.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@
1717

1818
import backoff
1919

20-
from google.api_core.exceptions import InternalServerError, NotFound, ServiceUnavailable
21-
from google.cloud import securitycentermanagement_v1
20+
from google.api_core.exceptions import InternalServerError, NotFound, ServiceUnavailable
2221

2322
import random
23+
24+
from google.cloud import securitycentermanagement_v1
25+
2426
import time
2527

2628
import pytest
@@ -114,7 +116,6 @@ def add_custom_module(org_id: str):
114116
print(f"Created Security Health Analytics Custom Module: {response.name}")
115117
module_name = response.name
116118
module_id = module_name.split("/")[-1]
117-
118119
return module_name, module_id
119120

120121

securitycenter/snippets_management_api/security_health_analytics_custom_modules.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
import time
1919
from typing import Dict
2020

21-
from google.cloud import securitycentermanagement_v1
2221
from google.api_core.exceptions import NotFound
22+
from google.cloud import securitycentermanagement_v1
2323

2424

2525
# [START securitycenter_create_security_health_analytics_custom_module]
@@ -52,14 +52,14 @@ def create_security_health_analytics_custom_module(parent: str) -> Dict:
5252
"description": (
5353
"Sample custom module for testing purposes. This custom module evaluates "
5454
"Cloud KMS CryptoKeys to ensure their rotation period exceeds 30 days (2592000 seconds)."
55-
),
55+
),
5656
"predicate": {
5757
"expression": "has(resource.rotationPeriod) && (resource.rotationPeriod > duration('2592000s'))",
5858
"title": "Cloud KMS CryptoKey Rotation Period",
5959
"description": (
6060
"Evaluates whether the rotation period of a Cloud KMS CryptoKey exceeds 30 days. "
6161
"A longer rotation period might increase the risk of exposure."
62-
),
62+
),
6363
},
6464
"recommendation": (
6565
"Review and adjust the rotation period for Cloud KMS CryptoKeys to align with your security policies. "
@@ -151,7 +151,7 @@ def list_security_health_analytics_custom_module(parent: str):
151151
custom_modules = []
152152
for custom_module in response:
153153
print(f"Custom Module: {custom_module.name}")
154-
custom_modules.append(custom_module)
154+
custom_modules.append(custom_module)
155155
return custom_modules
156156
except NotFound as e:
157157
print(f"Parent resource not found: {parent}")

0 commit comments

Comments
 (0)