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

Manage the static assets via a class #121

Merged
merged 2 commits into from
Sep 14, 2020
Merged

Conversation

ekohl
Copy link
Member

@ekohl ekohl commented Sep 14, 2020

Since 8c66bff the pulpcore-manager command runs as root. On a fresh installation this is fine, but on upgrades the user doesn't own /var/lib/pulp/assets. This explicitly manages the static root.

It is split off to a separate class to better capture the dependencies. The database doesn't need to refresh due to static files, nor any services.

@ekohl
Copy link
Member Author

ekohl commented Sep 14, 2020

The database doesn't need to refresh due to static files, nor any services.

I didn't verify this - it's true for "standard" Django, but with whitenoise this may not be true.

@ekohl
Copy link
Member Author

ekohl commented Sep 14, 2020

Note I extracted this from #115, which is why I assumed it was already done.

# @summary Manage the static files (assets)
# @api private
class pulpcore::static {
file { $pulpcore::static_root:
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this parameter $pulpcore::static_root was present in your other PR but didn't get included here, which is breaking things

Otherwise it looks good to me

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah yes, here it was still pulp_static_root.

Since 8c66bff the pulpcore-manager
command runs as root. On a fresh installation this is fine, but on
upgrades the user doesn't own /var/lib/pulp/assets. This explicitly
manages the static root.

It is split off to a separate class to better capture the dependencies.
The database doesn't need to refresh due to static files, nor any
services.
By setting it in settings.py, pulp-manager will also know about it. It
also makes the service file more straight forward.
@ekohl
Copy link
Member Author

ekohl commented Sep 14, 2020

I added a commit that sets STATIC_ROOT in settings.py. This was also taken from the new layout PR and I'd consider it a bugfix.

@wbclark wbclark added the Bug Something isn't working label Sep 14, 2020
Copy link
Collaborator

@wbclark wbclark left a comment

Choose a reason for hiding this comment

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

LGTM

@ekohl ekohl merged commit ae470e0 into theforeman:master Sep 14, 2020
@ekohl ekohl deleted the static-class branch September 14, 2020 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Needs testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants