Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

EOS-24098: Configure log directory #491

Merged
merged 9 commits into from
Sep 1, 2021
Merged

EOS-24098: Configure log directory #491

merged 9 commits into from
Sep 1, 2021

Conversation

selvakumaar5496
Copy link
Contributor

Signed-off-by: Selvakumar [email protected]

Problem Statement

  • Log directory for cortx-py-utils should be configurable

Design

  • Read log directory from cortx.conf file

Coding

  • Coding conventions are followed and code is consistent [Y/N]: Y
  • Confirm All CODACY errors are resolved [Y/N]: Y

Testing

  • Confirm that Test Cases are added (for both the cases, fix and feature) [Y/N]:
  • Confirm Test Cases cover Happy Path, Non-Happy Path and Scalability [Y/N]:
  • Confirm Testing was performed with installed RPM [Y/N]: Y

Review Checklist

Before posting the PR please ensure

  • PR is self reviewed
  • Is there a change in filename/package/module or signature [Y/N]:
  • If yes for above point, Is a notification sent to all other cortx components [Y/N]
  • Jira is updated
  • Check if the description is clear and explained.
  • Check Acceptance Criterion is defined.
  • All the tests performed should be mentioned before Resolving a JIRA.
  • Verification needs to be done before marked as Closed/Verified

Documentation

  • Changes done to WIKI / Confluence page

Signed-off-by: Selvakumar <[email protected]>
Signed-off-by: Selvakumar <[email protected]>
Signed-off-by: Selvakumar <[email protected]>
Conf.load('config_file', f'yaml:///{config_file_path}', skip_reload=True)
# Get the log path
log_dir = Conf.get('config_file', 'log_dir')
log_path = os.path.join(log_dir, 'cortx/utils')
Copy link
Contributor

@sachinpunadikar sachinpunadikar Aug 31, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

log_path -> utils_log_path
Applicable at other places as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@sachinpunadikar
Copy link
Contributor

Need to get the log_dir from passed in confstore (from provisioner / template file) in mini-provisioning. If this is not provided, there should be a default value

config_file_path = '/etc/cortx/cortx.conf'
Conf.load('config_file', f'yaml:///{config_file_path}', skip_reload=True)
# Get the log path
log_dir = Conf.get('config_file', 'log_dir', '/var/log')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be read from passed in information (like populated template file)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in utils_setup config phase

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

config phase will set the log_dir for rest of the code.
But utils_setup log will go to the default place (i.e. /var/log/..). Hence asking to get the required log directory here as well, and create log file for utils_setup in that directory.

Copy link
Contributor

@sachinpunadikar sachinpunadikar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please work on comment

Copy link
Contributor

@sachinpunadikar sachinpunadikar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@sachinpunadikar sachinpunadikar changed the base branch from main to kubernetes September 1, 2021 09:48
@sachinpunadikar sachinpunadikar merged commit 4f8d07a into Seagate:kubernetes Sep 1, 2021
vastradparayya pushed a commit to vastradparayya/cortx-utils that referenced this pull request Sep 1, 2021
* CORTX deployment on AWS

Signed-off-by: Shailesh Vaidya <[email protected]>

* Use $PWD 

Signed-off-by: Shailesh Vaidya <[email protected]>

* Removed ssc-vm details

Signed-off-by: Shailesh Vaidya <[email protected]>

* Removed SSC VM details

Signed-off-by: Shailesh Vaidya <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants