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

Fixes #23958 - Improve error message for file system access denial #96

Merged
merged 1 commit into from Jul 3, 2018

Conversation

xprazak2
Copy link
Contributor

The export to file system works correctly as far as I can tell. The exception is raised when path does not exist or the user does not have proper permissions set up. For example, exports to /root/repo will (correctly) fail on this because foreman does not even have read permissions for /root, therefore it cannot find /root/repo. Improving the error message is the only thing we can do here.

Copy link
Member

@ares ares left a comment

Choose a reason for hiding this comment

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

Makes sense, small nit only

@@ -33,7 +33,9 @@ def get_absolute_repo_path
end

def verify_path!(path)
raise "Using file-based synchronization, but couldn't find #{path}" unless Dir.exist?(path)
msg = _("Using file-based synchronization, but couldn't access %s to export templates. ") % path
msg += _("Please check the access permissions/SELinux and make sure it is writable for 'foreman' system user.")
Copy link
Member

Choose a reason for hiding this comment

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

Dev setups might run under different user. Can we either figure out current effective user or rephrase to something like the web application user account, typically 'foreman'

@ares
Copy link
Member

ares commented Jul 3, 2018

Works fine, thanks @xprazak2, merging.

@ares ares merged commit e194263 into theforeman:master Jul 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants