Skip to content

Commit 2114adf

Browse files
committed
fix single quotes usage
Signed-off-by: Javan Lacerda <javanlacerda@google.com>
1 parent 941c7d1 commit 2114adf

7 files changed

Lines changed: 27 additions & 27 deletions

File tree

src/clusterfuzz/_internal/batch/service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ def _get_config_names(batch_tasks: List[types.RemoteTask]):
209209
config_map = {}
210210
for task in batch_tasks:
211211
if task.job_type not in job_map:
212-
logs.error(f"{task.job_type} doesn't exist.")
212+
logs.error(f'{task.job_type} doesn\'t exist.')
213213
continue
214214
if task.command == 'fuzz':
215215
suffix = '-PREEMPTIBLE-UNPRIVILEGED'

src/clusterfuzz/_internal/datastore/feature_flags.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Google LLC
1+
# Copyright 2026 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -58,13 +58,13 @@ def description(self):
5858
"""Get a feature flag value."""
5959
flag = self.flag
6060
if not flag or flag.description is None:
61-
return ""
61+
return ''
6262
return flag.description
6363

6464
@property
6565
def string_value(self):
6666
"""Get a feature flag value."""
6767
flag = self.flag
6868
if not flag or flag.string_value is None:
69-
return ""
69+
return ''
7070
return flag.string_value

src/clusterfuzz/_internal/k8s/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2025 Google LLC
1+
# Copyright 2026 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

src/clusterfuzz/_internal/k8s/service.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def _get_config_names(remote_tasks: typing.List[types.RemoteTask]):
6262
config_map = {}
6363
for task in remote_tasks:
6464
if task.job_type not in job_map:
65-
logs.error(f"{task.job_type} doesn't exist.")
65+
logs.error(f'{task.job_type} doesn\'t exist.')
6666
continue
6767
if task.command == 'fuzz':
6868
suffix = '-PREEMPTIBLE-UNPRIVILEGED'
@@ -176,7 +176,7 @@ def _load_gke_credentials(self):
176176
credentials, _ = google.auth.default()
177177
project = utils.get_application_id()
178178
service = discovery.build('container', 'v1', credentials=credentials)
179-
parent = f"projects/{project}/locations/-"
179+
parent = f'projects/{project}/locations/-'
180180

181181
try:
182182
# pylint: disable=no-member
@@ -186,12 +186,12 @@ def _load_gke_credentials(self):
186186
cluster = next((c for c in clusters if c['name'] == CLUSTER_NAME), None)
187187

188188
if not cluster:
189-
logs.error(f"Cluster {CLUSTER_NAME} not found in project {project}.")
190-
print(f"DEBUG: Cluster {CLUSTER_NAME} not found in project {project}.")
189+
logs.error(f'Cluster {CLUSTER_NAME} not found in project {project}.')
190+
print(f'DEBUG: Cluster {CLUSTER_NAME} not found in project {project}.')
191191
return
192192

193193
except Exception as e:
194-
logs.error(f"Failed to list clusters in {project}: {e}")
194+
logs.error(f'Failed to list clusters in {project}: {e}')
195195
return
196196

197197
endpoint = cluster['endpoint']
@@ -212,13 +212,13 @@ def get_token(creds):
212212
request = google_requests.Request()
213213
if not creds.valid or creds.expired:
214214
creds.refresh(request)
215-
return {"authorization": "Bearer " + creds.token}
215+
return {'authorization': 'Bearer ' + creds.token}
216216

217217
configuration.refresh_api_key_hook = lambda _: get_token(credentials)
218218
configuration.api_key = get_token(credentials)
219219

220220
k8s_client.Configuration.set_default(configuration)
221-
logs.info("GKE credentials loaded successfully.")
221+
logs.info('GKE credentials loaded successfully.')
222222

223223
def _create_service_account_if_needed(self,
224224
service_account_email: str) -> str:
@@ -264,10 +264,10 @@ def _get_pending_jobs_count(self) -> int:
264264
namespace='default',
265265
label_selector='app.kubernetes.io/name=clusterfuzz-kata-job',
266266
field_selector='status.phase=Pending')
267-
logs.info(f"Found {len(pods.items)} pending jobs.")
267+
logs.info(f'Found {len(pods.items)} pending jobs.')
268268
return len(pods.items)
269269
except Exception as e:
270-
logs.error(f"Failed to list pods: {e}")
270+
logs.error(f'Failed to list pods: {e}')
271271
return 0
272272

273273
def create_utask_main_job(self, module: str, job_type: str,
@@ -308,9 +308,9 @@ def create_utask_main_jobs(self, remote_tasks: typing.List[types.RemoteTask]):
308308
logs.info(f'Scheduling {remote_task.command}, {remote_task.job_type}.')
309309
config = configs[(remote_task.command, remote_task.job_type)]
310310
job_specs[config].append(remote_task.input_download_url)
311-
logs.info('Creating batch jobs.')
311+
logs.info('Creating Kubernetes jobs.')
312312
jobs = []
313-
logs.info('Batching utask_mains.')
313+
logs.info('Batching k8s utask_mains.')
314314
for config, input_urls in job_specs.items():
315315
# TODO(javanlacerda): Batch multiple tasks into a single job.
316316
for input_url in input_urls:

src/clusterfuzz/_internal/remote_task/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def get_job_frequency(self):
9494

9595
if total_weight >= 1.0 and weight > 0.0:
9696
logs.warning(
97-
"Total weight for jobs frequency bigger than 1.0. Adapter starving",
97+
'Total weight for jobs frequency bigger than 1.0. Adapter starving',
9898
adapter=adapter.id)
9999
break
100100

@@ -106,7 +106,7 @@ def get_job_frequency(self):
106106
total_weight += weight
107107
frequencies[adapter.id] = weight if weight >= 0 else 0.0
108108

109-
logs.info("Job frequencies", frequencies=frequencies)
109+
logs.info('Job frequencies', frequencies=frequencies)
110110
return frequencies
111111

112112
def create_utask_main_job(self, module: str, job_type: str,

src/clusterfuzz/_internal/tests/core/k8s/k8s_integration_test.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,23 +75,23 @@ def test_load_credentials(self, mock_discovery_build, mock_auth_default,
7575

7676
# Verify configuration
7777
config = client.Configuration.get_default_copy()
78-
print(f"Loaded Host: {config.host}")
78+
print(f'Loaded Host: {config.host}')
7979

8080
# Check that we got a valid https endpoint
81-
self.assertTrue(config.host.startswith("https://"))
81+
self.assertTrue(config.host.startswith('https://'))
8282
self.assertTrue(config.verify_ssl)
8383
self.assertIsNotNone(config.ssl_ca_cert)
8484

8585
# Verify API key fix is present (Crucial for manual path)
86-
self.assertIn("authorization", config.api_key)
86+
self.assertIn('authorization', config.api_key)
8787

8888
# Verify hook is present
8989
self.assertIsNotNone(config.refresh_api_key_hook)
9090

9191
# Verify actual connectivity and auth
92-
print("Attempting to list jobs to verify authentication...")
92+
print('Attempting to list jobs to verify authentication...')
9393
k8s_service._batch_api.list_namespaced_job(namespace='default', limit=1)
94-
print("Successfully listed jobs.")
94+
print('Successfully listed jobs.')
9595

9696
finally:
9797
if old_kubeconfig:

src/clusterfuzz/_internal/tests/core/k8s/k8s_service_e2e_test.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ def test_create_job(self, mock_get_logging_config_dict):
213213

214214
self.assertTrue(
215215
job_running,
216-
f"Job {actual_job_name} did not start running. Status: {job.status}")
216+
f'Job {actual_job_name} did not start running. Status: {job.status}')
217217

218218
self.api_client.delete_namespaced_job(
219219
name=actual_job_name,
@@ -246,7 +246,7 @@ def test_create_kata_container_job(self, mock_get_logging_config_dict):
246246

247247
self.assertTrue(
248248
job_running,
249-
f"Kata Job {actual_job_name} did not start running. Status: {job.status}"
249+
f'Kata Job {actual_job_name} did not start running. Status: {job.status}'
250250
)
251251

252252
self.api_client.delete_namespaced_job(
@@ -294,7 +294,7 @@ def test_create_uworker_main_batch_job(self, mock_get_command_from_module,
294294

295295
self.assertTrue(
296296
job_running,
297-
f"Job {actual_job_name} did not start running. Status: {job.status}")
297+
f'Job {actual_job_name} did not start running. Status: {job.status}')
298298

299299
self.api_client.delete_namespaced_job(
300300
name=actual_job_name,
@@ -359,7 +359,7 @@ def test_create_uworker_main_batch_jobs(self, mock_get_command_from_module,
359359

360360
self.assertTrue(
361361
job_running,
362-
f"Job {job_name} did not start running. Status: {job.status}")
362+
f'Job {job_name} did not start running. Status: {job.status}')
363363

364364
self.api_client.delete_namespaced_job(
365365
name=job_name,

0 commit comments

Comments
 (0)