From dac22d93c804780f2dc20164aeb44fc80a30890d Mon Sep 17 00:00:00 2001 From: "Hansen, Tony (th1395)" Date: Fri, 19 Aug 2022 12:56:56 +0000 Subject: lots of cleanup, no functional code changes Change-Id: I9eefe4d34ae226bbd5a6f80422f89baeeaeb3471 Signed-off-by: Hansen, Tony (th1395) Issue-ID: DCAEGEN2-2837 --- miss_htbt_service/mod/trapd_exit.py | 9 +- miss_htbt_service/mod/trapd_get_cbs_config.py | 19 +- miss_htbt_service/mod/trapd_http_session.py | 5 +- miss_htbt_service/mod/trapd_io.py | 347 +------------------------- miss_htbt_service/mod/trapd_runtime_pid.py | 6 +- miss_htbt_service/mod/trapd_settings.py | 6 +- miss_htbt_service/mod/trapd_vnf_table.py | 31 ++- 7 files changed, 36 insertions(+), 387 deletions(-) (limited to 'miss_htbt_service/mod') diff --git a/miss_htbt_service/mod/trapd_exit.py b/miss_htbt_service/mod/trapd_exit.py index aae12bb..7791b31 100644 --- a/miss_htbt_service/mod/trapd_exit.py +++ b/miss_htbt_service/mod/trapd_exit.py @@ -1,5 +1,5 @@ # ============LICENSE_START======================================================= -# Copyright (c) 2017-2021 AT&T Intellectual Property. All rights reserved. +# Copyright (c) 2017-2022 AT&T Intellectual Property. All rights reserved. # Copyright (c) 2019 Pantheon.tech. All rights reserved. # Copyright (c) 2020 Deutsche Telekom. All rights reserved. # ================================================================================ @@ -25,8 +25,7 @@ __docformat__ = "restructuredtext" import sys import os -import string -from mod.trapd_runtime_pid import save_pid, rm_pid +from mod.trapd_runtime_pid import rm_pid prog_name = os.path.basename(__file__) @@ -57,7 +56,7 @@ def cleanup_and_exit(_loc_exit_code, _pid_file_name): # _num_params = len(locals()) if _pid_file_name is not None: - rc = rm_pid(_pid_file_name) + rm_pid(_pid_file_name) sys.exit(_loc_exit_code) @@ -87,4 +86,4 @@ def cleanup(_loc_exit_code, _pid_file_name): # _num_params = len(locals()) if _pid_file_name is not None: - rc = rm_pid(_pid_file_name) + rm_pid(_pid_file_name) diff --git a/miss_htbt_service/mod/trapd_get_cbs_config.py b/miss_htbt_service/mod/trapd_get_cbs_config.py index f9fd4c3..034b32b 100644 --- a/miss_htbt_service/mod/trapd_get_cbs_config.py +++ b/miss_htbt_service/mod/trapd_get_cbs_config.py @@ -1,5 +1,5 @@ # ============LICENSE_START======================================================= -# Copyright (c) 2018-2021 AT&T Intellectual Property. All rights reserved. +# Copyright (c) 2018-2022 AT&T Intellectual Property. All rights reserved. # Copyright (c) 2019 Pantheon.tech. All rights reserved. # Copyright (c) 2020 Deutsche Telekom. All rights reserved. # Copyright (c) 2021 Samsung Electronics. All rights reserved. @@ -27,11 +27,6 @@ __docformat__ = "restructuredtext" import json import os -import sys -import string -import time -import traceback -import collections.abc from onap_dcae_cbs_docker_client.client import get_config from mod import trapd_settings as tds from mod.trapd_exit import cleanup, cleanup_and_exit @@ -71,7 +66,7 @@ def get_cbs_config(): try: msg = "CBS_HTBT_JSON not defined - FATAL ERROR, exiting" _cbs_sim_json_file = os.getenv("CBS_HTBT_JSON", "None") - except Exception as e: + except Exception: stdout_logger(msg) cleanup(1, None) return False @@ -87,31 +82,31 @@ def get_cbs_config(): msg = "Unable to load CBS_HTBT_JSON " + _cbs_sim_json_file + " (invalid json?) - FATAL ERROR, exiting" try: tds.c_config = json.load(open(_cbs_sim_json_file)) - except Exception as e: + except Exception: stdout_logger(msg) cleanup_and_exit(0, None) # recalc timeout, set default if not present try: tds.timeout_seconds = tds.c_config["publisher.http_timeout_milliseconds"] / 1000.0 - except Exception as e: + except Exception: tds.timeout_seconds = 1.5 # recalc seconds_between_retries, set default if not present try: tds.seconds_between_retries = tds.c_config["publisher.http_milliseconds_between_retries"] / 1000.0 - except Exception as e: + except Exception: tds.seconds_between_retries = 0.750 # recalc min_severity_to_log, set default if not present try: tds.minimum_severity_to_log = tds.c_config["files.minimum_severity_to_log"] - except Exception as e: + except Exception: tds.minimum_severity_to_log = 3 try: tds.publisher_retries = tds.c_config["publisher.http_retries"] - except Exception as e: + except Exception: tds.publisher_retries = 3 return True diff --git a/miss_htbt_service/mod/trapd_http_session.py b/miss_htbt_service/mod/trapd_http_session.py index fc7e865..17eb302 100644 --- a/miss_htbt_service/mod/trapd_http_session.py +++ b/miss_htbt_service/mod/trapd_http_session.py @@ -1,5 +1,5 @@ # ============LICENSE_START======================================================= -# Copyright (c) 2017-2021 AT&T Intellectual Property. All rights reserved. +# Copyright (c) 2017-2022 AT&T Intellectual Property. All rights reserved. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -23,7 +23,6 @@ __docformat__ = "restructuredtext" import os import requests -import traceback prog_name = os.path.basename(__file__) @@ -48,7 +47,7 @@ def init_session_obj(): try: _loc_session = requests.Session() - except Exception as e: + except Exception: return None return _loc_session diff --git a/miss_htbt_service/mod/trapd_io.py b/miss_htbt_service/mod/trapd_io.py index 3e03999..26445fc 100644 --- a/miss_htbt_service/mod/trapd_io.py +++ b/miss_htbt_service/mod/trapd_io.py @@ -1,5 +1,5 @@ # ============LICENSE_START=======================================================) -# Copyright (c) 2018-2021 AT&T Intellectual Property. All rights reserved. +# Copyright (c) 2018-2022 AT&T Intellectual Property. All rights reserved. # Copyright (c) 2019 Pantheon.tech. All rights reserved. # Copyright (c) 2020 Deutsche Telekom. All rights reserved. # ================================================================================ @@ -23,352 +23,13 @@ __docformat__ = "restructuredtext" # basics import datetime -import errno -import inspect -import json -import logging -import logging.handlers import os -import sys -import string -import time -import traceback -import unicodedata - -# dcae_snmptrap -import mod.trapd_settings as tds -from mod.trapd_exit import cleanup_and_exit prog_name = os.path.basename(__file__) - -# # # # # # # # # # # # # # # # # # # -# fx: roll_all_logs -> roll all logs to timestamped backup -# # # # # # # # # # ## # # # # # # # - - -# def roll_all_logs(): -# """ -# roll all active logs to timestamped version, open new one -# based on frequency defined in files.roll_frequency -# """ -# -# # first roll all the eelf files -# # NOTE: this will go away when onap logging is standardized/available -# try: -# # open various ecomp logs - if any fails, exit -# for fd in [tds.eelf_error_fd, tds.eelf_debug_fd, tds.eelf_audit_fd, -# tds.eelf_metrics_fd, tds.arriving_traps_fd, tds.json_traps_fd]: -# fd.close() -# -# roll_file(tds.eelf_error_file_name) -# roll_file(tds.eelf_debug_file_name) -# roll_file(tds.eelf_audit_file_name) -# roll_file(tds.eelf_metrics_file_name) -# -# except Exception as e: -# msg = "Error closing logs: " + str(e) -# stdout_logger(msg) -# cleanup_and_exit(1, tds.pid_file_name) -# -# reopened_successfully = open_eelf_logs() -# if not reopened_successfully: -# msg = "Error re-opening EELF logs during roll-over to timestamped versions - EXITING" -# stdout_logger(msg) -# cleanup_and_exit(1, tds.pid_file_name) -# -# # json log -# roll_file(tds.json_traps_filename) - -## try: -# tds.json_traps_fd = open_file(tds.json_traps_filename) -# except Exception as e: -# msg = ("Error opening json_log %s : %s" % -# (json_traps_filename, str(e))) -# stdout_logger(msg) -# cleanup_and_exit(1, tds.pid_file_name) -# -# # arriving trap log -# roll_file(tds.arriving_traps_filename) -# -# try: -# tds.arriving_traps_fd = open_file(tds.arriving_traps_filename) -# except Exception as e: -# msg = ("Error opening arriving traps %s : %s" % -# (arriving_traps_filename, str(e))) -# stdout_logger(msg) -# cleanup_and_exit(1, tds.pid_file_name) -# -# -# # # # # # # # # # # # # # # # # # # -# fx: setup_ecomp_logs -> log in eelf format until standard -# is released for python via LOG-161 -# # # # # # # # # # ## # # # # # # # - - -# def open_eelf_logs(): -# """ -# open various (multiple ???) logs -# """ -# -# try: -# # open various ecomp logs - if any fails, exit -# -# tds.eelf_error_file_name = ( -# tds.c_config['files.eelf_base_dir'] + "/" + tds.c_config['files.eelf_error']) -# tds.eelf_error_fd = open_file(tds.eelf_error_file_name) -# -# except Exception as e: -# msg = "Error opening eelf error log : " + str(e) -# stdout_logger(msg) -# cleanup_and_exit(1, tds.pid_file_name) -# -# try: -# tds.eelf_debug_file_name = ( -# tds.c_config['files.eelf_base_dir'] + "/" + tds.c_config['files.eelf_debug']) -# tds.eelf_debug_fd = open_file(tds.eelf_debug_file_name) -# -# except Exception as e: -# msg = "Error opening eelf debug log : " + str(e) -# stdout_logger(msg) -# cleanup_and_exit(1, tds.pid_file_name) -# -# try: -# tds.eelf_audit_file_name = ( -# tds.c_config['files.eelf_base_dir'] + "/" + tds.c_config['files.eelf_audit']) -# tds.eelf_audit_fd = open_file(tds.eelf_audit_file_name) -# except Exception as e: -# msg = "Error opening eelf audit log : " + str(e) -# stdout_logger(msg) -# cleanup_and_exit(1, tds.pid_file_name) -# -# try: -# tds.eelf_metrics_file_name = ( -# tds.c_config['files.eelf_base_dir'] + "/" + tds.c_config['files.eelf_metrics']) -# tds.eelf_metrics_fd = open_file(tds.eelf_metrics_file_name) -# except Exception as e: -# msg = "Error opening eelf metric log : " + str(e) -# stdout_logger(msg) -# cleanup_and_exit(1, tds.pid_file_name) -# -# return True -# -## # # # # # # # # # # # # # # # # # # -# fx: roll_log_file -> move provided filename to timestamped version -# # # # # # # # # # ## # # # # # # # - - -# def roll_file(_loc_file_name): -# """ -# move active file to timestamped archive -# """ -# -# _file_name_suffix = "%s" % (datetime.datetime.fromtimestamp(time.time()). -# fromtimestamp(time.time()). -# strftime('%Y-%m-%dT%H:%M:%S')) -# -# _loc_file_name_bak = _loc_file_name + '.' + _file_name_suffix -# -# # roll existing file if present -# if os.path.isfile(_loc_file_name): -# try: -# os.rename(_loc_file_name, _loc_file_name_bak) -# return True -# except Exception as e: -# _msg = ("ERROR: Unable to rename %s to %s" -# % (_loc_file_name, -# _loc_file_name_bak)) -# ecomp_logger(tds.LOG_TYPE_ERROR, tds.SEV_CRIT, -# tds.CODE_GENERAL, _msg) -# return False -# -# return False -# -## # # # # # # # # # # # # -## fx: open_log_file -## # # # # # # # # # # # # -# -# -# def open_file(_loc_file_name): -# """ -# open _loc_file_name, return file handle -# """ -# -# try: -# # open append mode just in case so nothing is lost, but should be -# # non-existent file -# _loc_fd = open(_loc_file_name, 'a') -# return _loc_fd -# except Exception as e: -# msg = "Error opening " + _loc_file_name + " append mode - " + str(e) -# stdout_logger(msg) -# cleanup_and_exit(1, tds.pid_file_name) -# -# -## # # # # # # # # # # # # -## fx: close_file -## # # # # # # # # # # # # -# """ -# close _loc_file_name, return True with success, False otherwise -# """ -# -# -# def close_file(_loc_fd, _loc_filename): -# -# try: -# -# _loc_fd.close() -# return True -# except Exception as e: -# msg = "Error closing %s : %s - results indeterminate" % ( -# _loc_filename, str(e)) -# ecomp_logger(tds.LOG_TYPE_ERROR, tds.SEV_FATAL, tds.CODE_GENERAL, msg) -# return False -# -## # # # # # # # # # # # # # # # # # # -## fx: ecomp_logger -> log in eelf format until standard -## is released for python via LOG-161 -## # # # # # # # # # ## # # # # # # # -# -# def ecomp_logger(_log_type, _sev, _error_code, _msg): -# """ -# Log to ecomp-style logfiles. Logs include: -# -# Note: this will be updated when https://jira.onap.org/browse/LOG-161 -# is closed/available; until then, we resort to a generic format with -# valuable info in "extra=" field (?) -# -# :Parameters: -# _msg - -# :Exceptions: -# none -# :Keywords: -# eelf logging -# :Log Styles: -# -# :error.log: -# -# if CommonLogger.verbose: print("using CommonLogger.ErrorFile") -# self._logger.log(50, '%s|%s|%s|%s|%s|%s|%s|%s|%s|%s' \ -# % (requestID, threadID, serviceName, partnerName, targetEntity, targetServiceName, -# errorCategory, errorCode, errorDescription, detailMessage)) -# -# error.log example: -# -# 2018-02-20T07:21:34,007+00:00||MainThread|snmp_log_monitor||||FATAL|900||Tue Feb 20 07:21:11 UTC 2018 CRITICAL: [a0cae74e-160e-11e8-8f9f-0242ac110002] ALL publish attempts failed to DMAPP server: dcae-mrtr-zltcrdm5bdce1.1dff83.rdm5b.tci.att.com, topic: DCAE-COLLECTOR-UCSNMP, 339 trap(s) not published in epoch_serno range: 15191112530000 - 15191112620010 -# -# :debug.log: -# -# if CommonLogger.verbose: print("using CommonLogger.DebugFile") -# self._logger.log(50, '%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s' \ -# % (requestID, threadID, serverName, serviceName, instanceUUID, upperLogLevel, -# severity, serverIPAddress, server, IPAddress, className, timer, detailMessage)) -# -# debug.log example: -# -# none available -# -# :audit.log: -# -# if CommonLogger.verbose: print("using CommonLogger.AuditFile") -# endAuditTime, endAuditMsec = self._getTime() -# if self._begTime is not None: -# d = {'begtime': self._begTime, 'begmsecs': self._begMsec, 'endtime': endAuditTime, -# 'endmsecs': endAuditMsec} -# else: -# d = {'begtime': endAuditTime, 'begmsecs': endAuditMsec, 'endtime': endAuditTime, -# 'endmsecs': endAuditMsec} -# -# self._logger.log(50, '%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s' \ -# % (requestID, serviceInstanceID, threadID, serverName, serviceName, partnerName, -# statusCode, responseCode, responseDescription, instanceUUID, upperLogLevel, -# severity, serverIPAddress, timer, server, IPAddress, className, unused, -# processKey, customField1, customField2, customField3, customField4, -# detailMessage), extra=d) -# -# -# :metrics.log: -# -# self._logger.log(50,'%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s' \ -# % (requestID, serviceInstanceID, threadID, serverName, serviceName, partnerName, -# targetEntity, targetServiceName, statusCode, responseCode, responseDescription, -# instanceUUID, upperLogLevel, severity, serverIPAddress, timer, server, -# IPAddress, -# className, unused, processKey, targetVirtualEntity, customField1, customField2, -# customField3, customField4, detailMessage), extra=d) -# -# metrics.log example: -# -# none available -# -# -# """ -# -# unused = "" -# -# # above were various attempts at setting time string found in other -# # libs; instead, let's keep it real: -# t_out = datetime.datetime.utcnow().strftime("%Y-%m-%dT%H:%M:%S,%f")[:-3] -# calling_fx = inspect.stack()[1][3] -# -# # DLFM: this entire module is a hack to override concept of prog logging -# # written across multiple files (???), making diagnostics IMPOSSIBLE! -# # Hoping to leverage ONAP logging libraries & standards when available -# -# # catch invalid log type -# if _log_type < 1 or _log_type > 5: -# msg = ("INVALID log type: %s " % _log_type) -# _out_rec = ("%s|%s|%s|%s|%s|%s|%s|%s|%s" -# % (calling_fx, "snmptrapd", unused, unused, unused, tds.SEV_TYPES[_sev], _error_code, unused, (msg + _msg))) -# try: -# tds.eelf_error_fd.write('%s|%s\n' % (t_out, str(_out_rec))) -# except Exception as e: -# stdout_logger(str(_out_rec)) -# -# return False -# -# if _sev >= tds.minimum_severity_to_log: -# # log to appropriate eelf log (different files ??) -# if _log_type == tds.LOG_TYPE_ERROR: -# _out_rec = ('%s|%s|%s|%s|%s|%s|%s|%s|%s' -# % (calling_fx, "snmptrapd", unused, unused, unused, tds.SEV_TYPES[_sev], _error_code, unused, _msg)) -# try: -# tds.eelf_error_fd.write('%s|%s\n' % (t_out, str(_out_rec))) -# except Exception as e: -# stdout_logger(str(_out_rec)) -# elif _log_type == tds.LOG_TYPE_AUDIT: -# # log message in AUDIT format -# _out_rec = ('%s|%s|%s|%s|%s|%s|%s|%s|%s' -# % (calling_fx, "snmptrapd", unused, unused, unused, tds.SEV_TYPES[_sev], _error_code, unused, _msg)) -# try: -# tds.eelf_audit_fd.write('%s|%s\n' % (t_out, str(_out_rec))) -# except Exception as e: -# stdout_logger(str(_out_rec)) -# elif _log_type == tds.LOG_TYPE_METRICS: -# # log message in METRICS format -# _out_rec = ('%s|%s|%s|%s|%s|%s|%s|%s|%s' -# % (calling_fx, "snmptrapd", unused, unused, unused, tds.SEV_TYPES[_sev], _error_code, unused, _msg)) -# try: -# tds.eelf_metrics_fd.write('%s|%s\n' % (t_out, str(_out_rec))) -# except Exception as e: -# stdout_logger(str(_out_rec)) -# -# # DEBUG *AND* others - there *MUST BE* a single time-sequenced log for diagnostics! -# # DLFM: too much I/O !!! -# # always write to debug; we need ONE logfile that has time-sequence full view !!! -# # log message in DEBUG format -# _out_rec = ("%s|%s|%s|%s|%s|%s|%s|%s|%s" -# % (calling_fx, "snmptrapd", unused, unused, unused, tds.SEV_TYPES[_sev], _error_code, unused, _msg)) -# try: -# tds.eelf_debug_fd.write('%s|%s\n' % (t_out, str(_out_rec))) -# except Exception as e: -# stdout_logger(str(_out_rec)) -# -# return True -# -## # # # # # # # # # # # # -## fx: stdout_logger -## # # # # # # # # # # # # +# # # # # # # # # # # # # +# fx: stdout_logger +# # # # # # # # # # # # # def stdout_logger(_msg): diff --git a/miss_htbt_service/mod/trapd_runtime_pid.py b/miss_htbt_service/mod/trapd_runtime_pid.py index 47612bd..823d29f 100644 --- a/miss_htbt_service/mod/trapd_runtime_pid.py +++ b/miss_htbt_service/mod/trapd_runtime_pid.py @@ -1,5 +1,5 @@ # ============LICENSE_START======================================================= -# Copyright (c) 2017-2021 AT&T Intellectual Property. All rights reserved. +# Copyright (c) 2017-2022 AT&T Intellectual Property. All rights reserved. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,11 +21,7 @@ PID of currently running trap receiver) __docformat__ = "restructuredtext" -import logging import os -import string -import time -import traceback prog_name = os.path.basename(__file__) diff --git a/miss_htbt_service/mod/trapd_settings.py b/miss_htbt_service/mod/trapd_settings.py index 3e7f141..0f6a9a1 100644 --- a/miss_htbt_service/mod/trapd_settings.py +++ b/miss_htbt_service/mod/trapd_settings.py @@ -1,5 +1,5 @@ # ============LICENSE_START=======================================================) -# Copyright (c) 2018-2021 AT&T Intellectual Property. All rights reserved. +# Copyright (c) 2018-2022 AT&T Intellectual Property. All rights reserved. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -111,9 +111,9 @@ def init(): # global json_traps_filename - json_log_filename = "" + json_traps_filename = "" global json_traps_fd - json_fd = None + json_traps_fd = None # # diff --git a/miss_htbt_service/mod/trapd_vnf_table.py b/miss_htbt_service/mod/trapd_vnf_table.py index 1b00336..f9fecbb 100644 --- a/miss_htbt_service/mod/trapd_vnf_table.py +++ b/miss_htbt_service/mod/trapd_vnf_table.py @@ -1,5 +1,5 @@ # ============LICENSE_START======================================================= -# Copyright (c) 2017-2021 AT&T Intellectual Property. All rights reserved. +# Copyright (c) 2017-2022 AT&T Intellectual Property. All rights reserved. # Copyright (c) 2019 Pantheon.tech. All rights reserved. # Copyright (c) 2020 Deutsche Telekom. All rights reserved. # Copyright (c) 2021 Samsung Electronics. All rights reserved. @@ -18,7 +18,7 @@ # limitations under the License. # ============LICENSE_END========================================================= # -## Author Kiran Mandal (km386e) +# Author Kiran Mandal (km386e) """ trapd_vnf_table verifies the successful creation of DB Tables. @@ -30,7 +30,6 @@ import os.path as path import time import subprocess -import get_logger import db_monitoring as dbmon import htbtworker as pm import misshtbtd as db @@ -49,8 +48,8 @@ def hb_properties(): port_num = a["pg_portNum"] user_name = a["pg_userName"] password = a["pg_passwd"] - dbName = a["pg_dbName"] - db_name = dbName.lower() + db_name = a["pg_dbName"] + db_name = db_name.lower() cbs_polling_required = a["CBS_polling_allowed"] cbs_polling_interval = a["CBS_polling_interval"] s.close() @@ -61,7 +60,7 @@ def verify_DB_creation_1(user_name, password, ip_address, port_num, db_name): connection_db = pm.postgres_db_open(user_name, password, ip_address, port_num, db_name) try: _db_status = pm.db_table_creation_check(connection_db, "vnf_table_1") - except Exception as e: + except Exception: return None return _db_status @@ -72,7 +71,7 @@ def verify_DB_creation_2(user_name, password, ip_address, port_num, db_name): connection_db = pm.postgres_db_open(user_name, password, ip_address, port_num, db_name) try: _db_status = pm.db_table_creation_check(connection_db, "vnf_table_2") - except Exception as e: + except Exception: return None return _db_status @@ -83,7 +82,7 @@ def verify_DB_creation_hb_common(user_name, password, ip_address, port_num, db_n connection_db = pm.postgres_db_open(user_name, password, ip_address, port_num, db_name) try: _db_status = pm.db_table_creation_check(connection_db, "hb_common") - except Exception as e: + except Exception: return None return _db_status @@ -105,7 +104,7 @@ def verify_fetch_json_file(): try: db.fetch_json_file() result = True - except Exception as e: + except Exception: result = False print(result) os.unsetenv("pytest") @@ -124,7 +123,7 @@ def verify_misshtbtdmain(): try: db.main() result = True - except Exception as e: + except Exception: result = False print(result) os.unsetenv("pytest") @@ -142,7 +141,7 @@ def verify_dbmonitoring(): try: jsfile = db.fetch_json_file() ip_address, port_num, user_name, password, db_name, cbs_polling_required, cbs_polling_interval = hb_properties() - hbc_pid, hbc_state, hbc_srcName, hbc_time = db.read_hb_common( + hbc_pid, hbc_state, hbc_src_name, hbc_time = db.read_hb_common( user_name, password, ip_address, port_num, db_name ) dbmon.db_monitoring(hbc_pid, jsfile, user_name, password, ip_address, port_num, db_name) @@ -162,7 +161,7 @@ def verify_dbmon_startup(): try: p = subprocess.Popen(["./miss_htbt_service/db_monitoring.py"], stdout=subprocess.PIPE, shell=True) time.sleep(1) - except Exception as e: + except Exception: return None return True @@ -183,7 +182,7 @@ def verify_sendControlLoop_VNF_ONSET(): "1.0", "genVnfName", ) - except Exception as e: + except Exception: return None return _CL_return @@ -204,7 +203,7 @@ def verify_sendControlLoop_VM_ONSET(): "1.0", "genVnfName", ) - except Exception as e: + except Exception: return None return _CL_return @@ -225,7 +224,7 @@ def verify_sendControlLoop_VNF_ABATED(): "1.0", "genVnfName", ) - except Exception as e: + except Exception: return None return _CL_return @@ -246,6 +245,6 @@ def verify_sendControlLoop_VM_ABATED(): "1.0", "genVnfName", ) - except Exception as e: + except Exception: return None return _CL_return -- cgit 1.2.3-korg