Skip to content

Commit 4bd9e10

Browse files
partheagcf-owl-bot[bot]Benjamin E. Coe
authored
fix: drop usage of distutils (#541)
* fix: drop usage of distutils * lint * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * address review feedback * lint * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Benjamin E. Coe <bencoe@google.com>
1 parent e507ade commit 4bd9e10

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

google/api_core/operations_v1/abstract_operations_client.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
# limitations under the License.
1515
#
1616
from collections import OrderedDict
17-
from distutils import util
1817
import os
1918
import re
2019
from typing import Dict, Optional, Sequence, Tuple, Type, Union
@@ -294,13 +293,16 @@ def __init__(
294293
client_options = client_options_lib.ClientOptions()
295294

296295
# Create SSL credentials for mutual TLS if needed.
297-
use_client_cert = bool(
298-
util.strtobool(os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false"))
299-
)
300-
296+
use_client_cert = os.getenv(
297+
"GOOGLE_API_USE_CLIENT_CERTIFICATE", "false"
298+
).lower()
299+
if use_client_cert not in ("true", "false"):
300+
raise ValueError(
301+
"Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`"
302+
)
301303
client_cert_source_func = None
302304
is_mtls = False
303-
if use_client_cert:
305+
if use_client_cert == "true":
304306
if client_options.client_cert_source:
305307
is_mtls = True
306308
client_cert_source_func = client_options.client_cert_source

0 commit comments

Comments
 (0)