Skip to content

Commit d254a53

Browse files
committed
refactor(otlp exporter): refactor client certificate and key handling
- Moved `client_key_file` and `client_certificate_file` to local variables as suggested. - Added a comment explaining the retention of these as instance variables for testing purposes. - Addressed all review comments to improve code readability and maintainability.
1 parent e59453d commit d254a53

File tree

1 file changed

+4
-3
lines changed
  • exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc

1 file changed

+4
-3
lines changed

exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/exporter.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,11 @@ def _get_file_content(file_path: str) -> bytes:
124124
with open(file_path, "rb") as file:
125125
return file.read()
126126

127+
127128
def _load_credentials(
128-
certificate_file: Optional[str],
129-
client_key_file: Optional[str],
130-
client_certificate_file: Optional[str],
129+
certificate_file: str,
130+
client_key_file: str,
131+
client_certificate_file: str,
131132
) -> Optional[ChannelCredentials]:
132133
try:
133134
root_certificates = _get_file_content(certificate_file)

0 commit comments

Comments
 (0)