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

Fix error that occurs when config file deleted. #193

Merged
merged 1 commit into from
Jun 5, 2018

Conversation

marcparadise
Copy link
Member

Signed-off-by: Marc A. Paradise marc.paradise@gmail.com

Description

When the default configuration file is deleted, and
a custom file is not specified, chef-run emits a stack trace
due to failure loading the missing file.

This can happen when the customer deletes or removes the default
config.toml. chef-run creates the file only on first-run, so if it's
removed after that point it stays gone.

Because we have to assume the customer had a reason for deleting the
configuration file, we can't recreate a new empty file. Instead,
this fix changes it so that if the config file is missing, we don't try
to load it. This will leave configuration defaults in place.

Issues Resolved

  • n/a

Check List

When the default ocnfiguration file is deleted, and
a custom file is not specified, chef-run emits a stack trace
due to failure loading the missing file.

This can happen when the customer deletes or removes the default
config.toml. chef-run creates the file only on first-run, so if it's
removed after that point it stays gone.

Because we have to assume the customer had a reason for deleting the
configuration file, we can't recreate a new empty file.  Instead,
this fix changes it so that if the config file is missing, we don't try
to load it. This will leave configuration defaults in place.

Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
@marcparadise marcparadise requested a review from a team June 5, 2018 15:20
Copy link
Contributor

@tyler-ball tyler-ball left a comment

Choose a reason for hiding this comment

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

tenor-157688511

@marcparadise marcparadise merged commit 12f654f into master Jun 5, 2018
@chef-ci chef-ci deleted the mp/fix-missing-config-file branch June 5, 2018 18:23
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.

3 participants