aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/python/grpcio_test/grpc_interop/resources.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/python/grpcio_test/grpc_interop/resources.py')
-rw-r--r--src/python/grpcio_test/grpc_interop/resources.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/python/grpcio_test/grpc_interop/resources.py b/src/python/grpcio_test/grpc_interop/resources.py
index 2c3045313d..1122499418 100644
--- a/src/python/grpcio_test/grpc_interop/resources.py
+++ b/src/python/grpcio_test/grpc_interop/resources.py
@@ -29,6 +29,7 @@
"""Constants and functions for data used in interoperability testing."""
+import argparse
import os
import pkg_resources
@@ -54,3 +55,11 @@ def private_key():
def certificate_chain():
return pkg_resources.resource_string(
__name__, _CERTIFICATE_CHAIN_RESOURCE_PATH)
+
+
+def parse_bool(value):
+ if value == 'true':
+ return True
+ if value == 'false':
+ return False
+ raise argparse.ArgumentTypeError('Only true/false allowed')