From 00107ed0ee9911ac761a544bada794a1ebb26ddf Mon Sep 17 00:00:00 2001 From: Bartek Grzybowski Date: Mon, 23 Mar 2020 14:42:04 +0100 Subject: Fix whitespace issues in Python files Change-Id: I7c98d1187c24b58471a822ec6f0fb9b0999f6f39 Issue-ID: INT-1482 Signed-off-by: Bartek Grzybowski --- vnfs/DAaaS/lib/promql_api/prom_ql_api.py | 6 +++--- .../src/consumer/CustomKafkaConsumer.py | 2 +- .../PythonApps/python-kafkaConsumer-inference-app/src/main.py | 2 +- .../src/producer/CustomKafkaProducer.py | 2 +- .../python-kafkaConsumer-inference-app/src/utils/utils.py | 1 - vnfs/DAaaS/sample-apps/m3db_promql/build/sample_promql_query.py | 2 +- .../sample-minio-load-model/build/load-model-from-minio.py | 4 ++-- .../sample-minio-save-model/build/save-model-to-minio.py | 7 +++---- 8 files changed, 12 insertions(+), 14 deletions(-) (limited to 'vnfs/DAaaS') diff --git a/vnfs/DAaaS/lib/promql_api/prom_ql_api.py b/vnfs/DAaaS/lib/promql_api/prom_ql_api.py index 1dc578e9..2ee273a0 100644 --- a/vnfs/DAaaS/lib/promql_api/prom_ql_api.py +++ b/vnfs/DAaaS/lib/promql_api/prom_ql_api.py @@ -128,7 +128,7 @@ def validate_parameters(map_of_parameters): raise Exception(':: Value Paramter of key: \'{}\' NOT a string! Values should be string ::'.format(k)) return True - + def query_range(map_of_parameters): list_of_result_sets = [] set_log_config() @@ -136,7 +136,7 @@ def query_range(map_of_parameters): LOG.info(':::Validation of map_of_parameters done::') load_and_validate_env_vars(LIST_OF_ENV_VARIABLES) LOG.info("Forming the query_range request ...") - + list_of_substrings = [] list_of_substrings.append(MAP_ENV_VARIABLES['DATA_ENDPOINT']) list_of_substrings.append(QUERY_RANGE_API_VERSION) @@ -168,4 +168,4 @@ def query_range(map_of_parameters): LOG.info('::::::::::RESULTS OF QUERY_RANGE::::::::::::: {}'.format(map_of_parameters)) list_of_result_sets.append(results) - return list_of_result_sets \ No newline at end of file + return list_of_result_sets diff --git a/vnfs/DAaaS/microservices/PythonApps/python-kafkaConsumer-inference-app/src/consumer/CustomKafkaConsumer.py b/vnfs/DAaaS/microservices/PythonApps/python-kafkaConsumer-inference-app/src/consumer/CustomKafkaConsumer.py index 1e311bf1..6d3fd612 100644 --- a/vnfs/DAaaS/microservices/PythonApps/python-kafkaConsumer-inference-app/src/consumer/CustomKafkaConsumer.py +++ b/vnfs/DAaaS/microservices/PythonApps/python-kafkaConsumer-inference-app/src/consumer/CustomKafkaConsumer.py @@ -117,4 +117,4 @@ class CustomKafkaConsumer: # print("msg-value-type:: {}".format(type(msg.value().decode('utf-8')))) self.processMessage(msg.key(), msg.value()) - self.consumer.close() \ No newline at end of file + self.consumer.close() diff --git a/vnfs/DAaaS/microservices/PythonApps/python-kafkaConsumer-inference-app/src/main.py b/vnfs/DAaaS/microservices/PythonApps/python-kafkaConsumer-inference-app/src/main.py index bf62f50f..8d013b40 100755 --- a/vnfs/DAaaS/microservices/PythonApps/python-kafkaConsumer-inference-app/src/main.py +++ b/vnfs/DAaaS/microservices/PythonApps/python-kafkaConsumer-inference-app/src/main.py @@ -44,4 +44,4 @@ def main(): if __name__ == '__main__': - main() \ No newline at end of file + main() diff --git a/vnfs/DAaaS/microservices/PythonApps/python-kafkaConsumer-inference-app/src/producer/CustomKafkaProducer.py b/vnfs/DAaaS/microservices/PythonApps/python-kafkaConsumer-inference-app/src/producer/CustomKafkaProducer.py index 8f726bd9..43303761 100644 --- a/vnfs/DAaaS/microservices/PythonApps/python-kafkaConsumer-inference-app/src/producer/CustomKafkaProducer.py +++ b/vnfs/DAaaS/microservices/PythonApps/python-kafkaConsumer-inference-app/src/producer/CustomKafkaProducer.py @@ -35,4 +35,4 @@ class CustomKafkaProducer: logging.error('%s raised an error', err) else: logging.info("Message delivered to %s on partition %s", - msg.topic(), msg.partition()) \ No newline at end of file + msg.topic(), msg.partition()) diff --git a/vnfs/DAaaS/microservices/PythonApps/python-kafkaConsumer-inference-app/src/utils/utils.py b/vnfs/DAaaS/microservices/PythonApps/python-kafkaConsumer-inference-app/src/utils/utils.py index 4ed3b47b..f5f42ec2 100644 --- a/vnfs/DAaaS/microservices/PythonApps/python-kafkaConsumer-inference-app/src/utils/utils.py +++ b/vnfs/DAaaS/microservices/PythonApps/python-kafkaConsumer-inference-app/src/utils/utils.py @@ -5,4 +5,3 @@ class utils: def readFile(self, fileName): pass - diff --git a/vnfs/DAaaS/sample-apps/m3db_promql/build/sample_promql_query.py b/vnfs/DAaaS/sample-apps/m3db_promql/build/sample_promql_query.py index 2c85f1f8..844189bd 100644 --- a/vnfs/DAaaS/sample-apps/m3db_promql/build/sample_promql_query.py +++ b/vnfs/DAaaS/sample-apps/m3db_promql/build/sample_promql_query.py @@ -43,6 +43,6 @@ def main(): demo_query() demo_query_range() - + if __name__ == "__main__": main() diff --git a/vnfs/DAaaS/sample-apps/sample-minio-load-model/build/load-model-from-minio.py b/vnfs/DAaaS/sample-apps/sample-minio-load-model/build/load-model-from-minio.py index dbdabc3a..eae66d72 100755 --- a/vnfs/DAaaS/sample-apps/sample-minio-load-model/build/load-model-from-minio.py +++ b/vnfs/DAaaS/sample-apps/sample-minio-load-model/build/load-model-from-minio.py @@ -35,7 +35,7 @@ client = Minio(os.environ['S3_ENDPOINT'], secure=False) -def load_model(bucket_name, object_name, filepath): +def load_model(bucket_name, object_name, filepath): try: client.fget_object(bucket_name, object_name, filepath) except ResponseError as err: @@ -48,4 +48,4 @@ if __name__ == "__main__": for object_name in objects: print(f"Load model from s3://{bucket_name}/{object_name} to {filepath+object_name}") load_model(bucket_name, object_name, filepath+object_name) - time.sleep(300) \ No newline at end of file + time.sleep(300) diff --git a/vnfs/DAaaS/sample-apps/sample-minio-save-model/build/save-model-to-minio.py b/vnfs/DAaaS/sample-apps/sample-minio-save-model/build/save-model-to-minio.py index b4535220..1963cd3d 100755 --- a/vnfs/DAaaS/sample-apps/sample-minio-save-model/build/save-model-to-minio.py +++ b/vnfs/DAaaS/sample-apps/sample-minio-save-model/build/save-model-to-minio.py @@ -35,7 +35,7 @@ client = Minio(os.environ['S3_ENDPOINT'], secure=False) -def load_model(bucket_name, object_name, filepath): +def load_model(bucket_name, object_name, filepath): try: client.fget_object(bucket_name, object_name, filepath) except ResponseError as err: @@ -48,14 +48,14 @@ if __name__ == "__main__": filepath = "/app/" + model if not client.bucket_exists(bucket_name): client.make_bucket(bucket_name, location=location) - + found = False try: client.stat_object(bucket_name, model); found = True except Exception as err: found = False - + metadata = { "X-Amz-Meta-model-description": "Sample numpy model", "X-Amz-Meta-model-type": "scikit-learn/numpy", @@ -66,4 +66,3 @@ if __name__ == "__main__": client.fput_object(bucket_name, model, filepath, metadata=metadata) except expression as identifier: print(err) - -- cgit 1.2.3-korg