Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New config file now takes precedence over old one. #151

Merged
merged 1 commit into from
May 4, 2018

Conversation

tonyskapunk
Copy link
Contributor

This is continuation of #80

On the last release 1.3.0:

Following the plan(#137 (comment)) This PR is focusing on the goals for 1.4.0, the logic is:

  • If both configs(/etc/recap and /etc/recap.conf) are found, /etc/recap.conf takes now precedence.
  • If only /etc/recap is found then is read and a warning is logged to let the user know next version this will be ignored.
  • If no config is found a warning is logged, defaults are used.
  • If only /etc/recap.conf is found then is read.

version 1.3.0

  • Both configs found, old takes precedence:
2018-04-13 11:30:15-05:00 [WARNING] Configuration files exist at old(/etc/recap) and new(/etc/recap.conf) locations. The file from the old location will be read.
2018-04-13 11:30:15-05:00 [WARNING] Please move your configuration to /etc/recap.conf
  • Only old config is found:
2018-04-13 11:35:36-05:00 [WARNING] Configuration file exists at old(/etc/recap) location.  The file will be read.
/usr/bin/recap: line 752: Please move your configuration file to /etc/recap.conf.: No such file or directory
  • No config is found:
2018-04-13 11:37:08-05:00 [WARNING] No configuration file found. Expecting /etc/recap.conf.
2018-04-13 11:37:08-05:00 [WARNING] Proceeding with defaults.
  • No warning is logged when only new config is found

This PR (intended for 1.4.0) will show:

  • Both configs found, new one takes precedence:
2018-04-13 11:46:10-05:00 [WARNING] Configuration files exist at old(/etc/recap) and new(/etc/recap.conf) locations. The file from the new location will be used.
2018-04-13 11:46:10-05:00 [WARNING] Please move any missing configuration to /etc/recap.conf.
  • Only old config is found:
2018-04-13 11:47:04-05:00 [WARNING] Configuration file exists at old(/etc/recap) location. The file will be read. Please move your configuration file to /etc/recap.conf. Next version of recap will not read /etc/recap
  • No config is found:
2018-04-13 11:47:43-05:00 [WARNING] No configuration file found. Expecting /etc/recap.conf.
2018-04-13 11:47:43-05:00 [WARNING] Proceeding with defaults.
  • No warning is logged when only new config is found

@tonyskapunk tonyskapunk mentioned this pull request Apr 13, 2018
@tonyskapunk
Copy link
Contributor Author

Merging this one into development

@tonyskapunk tonyskapunk merged commit ec849e1 into rackerlabs:development May 4, 2018
@tonyskapunk tonyskapunk deleted the issue80 branch May 4, 2018 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant