Skip to content

Commit

Permalink
small fixes and copyright
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Nov 14, 2024
1 parent 5baf131 commit bcdf34e
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions plugins/fluentd_telemetry_plugin/src/merge_configuration_files.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
"""
@copyright:
Copyright (C) Mellanox Technologies Ltd. 2014-2020. ALL RIGHTS RESERVED.
This software product is a proprietary product of Mellanox Technologies
Ltd. (the "Company") and all right, title, and interest in and to the
software product, including all associated intellectual property rights,
are and shall remain exclusively with the Company.
This software product is governed by the End User License Agreement
provided with the software product.
@author: Miryam Schwartz
@date: Oct 14, 2024
"""
import configparser
import logging
import sys
Expand All @@ -6,10 +21,10 @@
def merge_ini_files(old_file_path, new_file_path):
# Check if files exist
if not os.path.isfile(old_file_path):
logging.error(f"file %s does not exist.", old_file_path)
logging.error("file %s does not exist.", old_file_path)
sys.exit(1)
if not os.path.isfile(new_file_path):
logging.error(f"file %s does not exist.", new_file_path)
logging.error("file %s does not exist.", new_file_path)
sys.exit(1)

# Create a configparser object
Expand All @@ -22,7 +37,7 @@ def merge_ini_files(old_file_path, new_file_path):
config_new.read(new_file_path)

except configparser.Error as e:
logging.error(f"Failed to parse configurations files: %s", e)
logging.error("Failed to parse configurations files: %s", e)
sys.exit(1)

# Merge configurations
Expand All @@ -39,7 +54,7 @@ def merge_ini_files(old_file_path, new_file_path):
with open(old_file_path, 'w', encoding="utf-8") as configfile:
config_old.write(configfile)

logging.info(f"Configuration has been merged and saved to %s", old_file_path)
logging.info("Configuration has been merged and saved to %s", old_file_path)

if __name__ == "__main__":
# Get file paths from command line arguments
Expand Down

0 comments on commit bcdf34e

Please sign in to comment.