package log name & filename fixes when update plugin package
@@ -106,9 +106,9 @@ def update_repo_sources_and_plugin(_type: str, name: str) -> tuple:
# For endpoint curl -X GET http://localhost:8081/foglamp/plugins/available we used
# sudo apt list command internal so package name always returns in lowercase,
# irrespective of package name defined in the configured repo.
- name = name.lower()
+ name = "foglamp-{}-{}".format(_type, name.lower())
_platform = platform.platform()
- stdout_file_path = common.create_log_file(name)
+ stdout_file_path = common.create_log_file(action="update", plugin_name=name)
pkg_mgt = 'apt'
cmd = "sudo {} -y update > {} 2>&1".format(pkg_mgt, stdout_file_path)
if 'centos' in _platform or 'redhat' in _platform:
@@ -117,7 +117,7 @@ def update_repo_sources_and_plugin(_type: str, name: str) -> tuple:
ret_code = os.system(cmd)
# sudo apt/yum -y install only happens when update is without any error
if ret_code == 0:
- cmd = "sudo {} -y install foglamp-{}-{} >> {} 2>&1".format(pkg_mgt, _type, name, stdout_file_path)
+ cmd = "sudo {} -y install {} >> {} 2>&1".format(pkg_mgt, name, stdout_file_path)
ret_code = os.system(cmd)
# relative log file link
