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

Add flag to exercise django's STORAGES setting on CI #941

Merged
merged 3 commits into from
Jan 15, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions templates/github/.ci/ansible/settings.py.j2.copy
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,29 @@ API_ROOT = {{ api_root | repr }}

{% if pulp_scenario_settings is defined and pulp_scenario_settings %}
{% for key, value in pulp_scenario_settings.items() %}
{% if not (s3_test | default(false) and key == "STORAGES") %}
{{ key | upper }} = {{ value | repr }}
{% endif %}
{% endfor %}
{% endif %}

{% if s3_test | default(false) %}
MEDIA_ROOT: ""
S3_USE_SIGV4 = True
{% if "STORAGES" in pulp_scenario_settings %}
STORAGES = {{ pulp_scenario_settings["STORAGES"] }}
Copy link
Member

Choose a reason for hiding this comment

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

Is the | repr the reason why you need to single out this line? Is this related to the "{{ minio_access_key }}" part?

Copy link
Member Author

Choose a reason for hiding this comment

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

TBH I dont know, but maybe.
The reason was to keep the alternatives explicit

{% else %}
DEFAULT_FILE_STORAGE = "storages.backends.s3boto3.S3Boto3Storage"
MEDIA_ROOT = ""
AWS_ACCESS_KEY_ID = "{{ minio_access_key }}"
AWS_SECRET_ACCESS_KEY = "{{ minio_secret_key }}"
AWS_S3_REGION_NAME = "eu-central-1"
AWS_S3_ADDRESSING_STYLE = "path"
S3_USE_SIGV4 = True
AWS_S3_SIGNATURE_VERSION = "s3v4"
AWS_STORAGE_BUCKET_NAME = "pulp3"
AWS_S3_ENDPOINT_URL = "http://minio:9000"
AWS_DEFAULT_ACL = "@none None"
{% endif %}
{% endif %}

{% if azure_test | default(false) %}
DEFAULT_FILE_STORAGE = "storages.backends.azure_storage.AzureStorage"
Expand Down
Loading