diff --git a/src/environment_provider/environment.py b/src/environment_provider/environment.py index 36bf439..8f1fbda 100644 --- a/src/environment_provider/environment.py +++ b/src/environment_provider/environment.py @@ -34,6 +34,7 @@ TRACER = trace.get_tracer(__name__) + def checkin_provider( item: dict, provider: Union[IutProvider, ExecutionSpaceProvider, LogAreaProvider] ) -> tuple[bool, Optional[Exception]]: @@ -79,13 +80,13 @@ def release_environment( failure = None - span_name="stop_iuts" + span_name = "stop_iuts" with TRACER.start_as_current_span(span_name): success, exception = checkin_provider(Iut(**iut), IutProvider(etos, jsontas, iut_ruleset)) if not success: failure = exception - span_name="stop_log_area" + span_name = "stop_log_area" with TRACER.start_as_current_span(span_name): success, exception = checkin_provider( LogArea(**log_area), LogAreaProvider(etos, jsontas, log_area_ruleset) @@ -93,7 +94,7 @@ def release_environment( if not success: failure = exception - span_name="stop_execution_space" + span_name = "stop_execution_space" with TRACER.start_as_current_span(span_name): success, exception = checkin_provider( ExecutionSpace(**executor), diff --git a/src/environment_provider/environment_provider.py b/src/environment_provider/environment_provider.py index 39b9d1a..293c0e9 100644 --- a/src/environment_provider/environment_provider.py +++ b/src/environment_provider/environment_provider.py @@ -413,8 +413,7 @@ def checkout( self.environment_provider_config, ) finished = [] - timeout = self.checkout_timeout() - while time.time() < timeout: + while time.time() < self.checkout_timeout(): self.set_total_test_count_and_test_runners(test_runners) with self.tracer.start_as_current_span("request_iuts") as span: diff --git a/src/execution_space_provider/utilities/external_provider.py b/src/execution_space_provider/utilities/external_provider.py index a604509..08c2b35 100644 --- a/src/execution_space_provider/utilities/external_provider.py +++ b/src/execution_space_provider/utilities/external_provider.py @@ -121,7 +121,6 @@ def checkin(self, execution_space: ExecutionSpace) -> None: otel_span.set_attribute("request.host", host) otel_span.set_attribute("request.headers", json.dumps(headers, indent=4)) otel_span.set_attribute("request.body", json.dumps(execution_spaces, indent=4)) - #opentelemetry.propagate.inject(headers) # inject current OpenTelemetry conext to HTTP request headers self.logger.info("OpenTelemetry context headers: %s", headers) timeout = time.time() + end first_iteration = True @@ -131,9 +130,7 @@ def checkin(self, execution_space: ExecutionSpace) -> None: else: time.sleep(2) try: - response = requests.post( - host, json=execution_spaces, headers=headers - ) + response = requests.post(host, json=execution_spaces, headers=headers) if response.status_code == requests.codes["no_content"]: return response = response.json() @@ -201,7 +198,6 @@ def start(self, minimum_amount: int, maximum_amount: int) -> str: otel_span.set_attribute("request.host", host) otel_span.set_attribute("request.headers", json.dumps(headers, indent=4)) otel_span.set_attribute("request.body", json.dumps(data, indent=4)) - #opentelemetry.propagate.inject(headers) # inject current OpenTelemetry conext to HTTP request headers self.logger.info("OpenTelemetry context headers: %s", headers) try: response = self.http.post( @@ -236,7 +232,6 @@ def wait(self, provider_id: str) -> dict: else: time.sleep(2) headers = {"X-ETOS-ID": self.identifier} - #opentelemetry.propagate.inject(headers) # inject current OpenTelemetry conext to HTTP request headers self.logger.info("OpenTelemetry context headers: %s", headers) try: response = requests.get( diff --git a/src/log_area_provider/utilities/external_provider.py b/src/log_area_provider/utilities/external_provider.py index 36eef53..b0bdd6b 100644 --- a/src/log_area_provider/utilities/external_provider.py +++ b/src/log_area_provider/utilities/external_provider.py @@ -124,9 +124,7 @@ def checkin(self, log_area: LogArea) -> None: else: time.sleep(2) try: - response = requests.post( - host, json=log_areas, headers=headers - ) + response = requests.post(host, json=log_areas, headers=headers) if response.status_code == requests.codes["no_content"]: return response = response.json()