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

Adding conditional processing of swift auth parameters #24

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
14 changes: 12 additions & 2 deletions glance/files/newton/glance-glare.conf.Debian
Original file line number Diff line number Diff line change
Expand Up @@ -1361,7 +1361,9 @@ rbd_store_ceph_conf = /etc/ceph/ceph.conf

{%- if 'swift' in storage_engines %}
#swift_store_auth_insecure = false
{%- if server.storage.swift.store.get('auth', {}).get('insecure', False) %}
swift_store_auth_insecure = {{ server.storage.swift.store.auth.get('insecure', False)|lower }}
{% endif %}

#
# Path to the CA bundle file.
Expand Down Expand Up @@ -1809,7 +1811,9 @@ default_swift_reference = {{ server.storage.swift.store.default_swift_reference
# The option 'auth_version' in the Swift back-end configuration file is
# used instead.
#swift_store_auth_version = 2
{%- if server.storage.swift.store.get('auth', {}).get('version', False) %}
swift_store_auth_version = {{ server.storage.swift.store.auth.version }}
{% endif %}

# DEPRECATED: The address where the Swift authentication service is listening.
# (string value)
Expand All @@ -1819,7 +1823,9 @@ swift_store_auth_version = {{ server.storage.swift.store.auth.version }}
# The option 'auth_address' in the Swift back-end configuration file is
# used instead.
#swift_store_auth_address = <None>
{%- if server.storage.swift.store.get('auth', {}).get('address', False) %}
swift_store_auth_address = {{ server.storage.swift.store.auth.address }}
{% endif %}

# DEPRECATED: The user to authenticate against the Swift authentication service.
# (string value)
Expand All @@ -1828,7 +1834,9 @@ swift_store_auth_address = {{ server.storage.swift.store.auth.address }}
# Reason:
# The option 'user' in the Swift back-end configuration file is set instead.
#swift_store_user = <None>
{%- if server.storage.swift.store.get('user', False) %}
swift_store_user = {{ server.storage.swift.store.user }}
{% endif %}

# DEPRECATED: Auth key for the user authenticating against the Swift
# authentication service. (string value)
Expand All @@ -1838,7 +1846,9 @@ swift_store_user = {{ server.storage.swift.store.user }}
# The option 'key' in the Swift back-end configuration file is used
# to set the authentication key instead.
#swift_store_key = <None>
{%- if server.storage.swift.store.get('key', False) %}
swift_store_key = {{ server.storage.swift.store.key }}
{% endif %}

#
# Absolute path to the file containing the swift account(s)
Expand All @@ -1860,8 +1870,8 @@ swift_store_key = {{ server.storage.swift.store.key }}
#
# (string value)
#swift_store_config_file = <None>
{% if server.storage.swift.store.config_file is defined %}
swift_store_config_file = {{ server.storage.swift.store.config_file }}
{% if server.storage.swift.store.references is defined %}
swift_store_config_file = /etc/glance/swift-stores.conf
{% endif %}

{% endif %}
Expand Down
14 changes: 12 additions & 2 deletions glance/files/ocata/glance-glare.conf.Debian
Original file line number Diff line number Diff line change
Expand Up @@ -1363,7 +1363,9 @@ rbd_store_ceph_conf = /etc/ceph/ceph.conf

{%- if 'swift' in storage_engines %}
#swift_store_auth_insecure = false
{%- if server.storage.swift.store.get('auth', {}).get('insecure', False) %}
swift_store_auth_insecure = {{ server.storage.swift.store.auth.get('insecure', False)|lower }}
{% endif %}

#
# Path to the CA bundle file.
Expand Down Expand Up @@ -1811,7 +1813,9 @@ default_swift_reference = {{ server.storage.swift.store.default_swift_reference
# The option 'auth_version' in the Swift back-end configuration file is
# used instead.
#swift_store_auth_version = 2
{%- if server.storage.swift.store.get('auth', {}).get('version', False) %}
swift_store_auth_version = {{ server.storage.swift.store.auth.version }}
{% endif %}

# DEPRECATED: The address where the Swift authentication service is listening.
# (string value)
Expand All @@ -1821,7 +1825,9 @@ swift_store_auth_version = {{ server.storage.swift.store.auth.version }}
# The option 'auth_address' in the Swift back-end configuration file is
# used instead.
#swift_store_auth_address = <None>
{%- if server.storage.swift.store.get('auth', {}).get('address', False) %}
swift_store_auth_address = {{ server.storage.swift.store.auth.address }}
{% endif %}

# DEPRECATED: The user to authenticate against the Swift authentication service.
# (string value)
Expand All @@ -1830,7 +1836,9 @@ swift_store_auth_address = {{ server.storage.swift.store.auth.address }}
# Reason:
# The option 'user' in the Swift back-end configuration file is set instead.
#swift_store_user = <None>
{%- if server.storage.swift.store.get('user', False) %}
swift_store_user = {{ server.storage.swift.store.user }}
{% endif %}

# DEPRECATED: Auth key for the user authenticating against the Swift
# authentication service. (string value)
Expand All @@ -1840,7 +1848,9 @@ swift_store_user = {{ server.storage.swift.store.user }}
# The option 'key' in the Swift back-end configuration file is used
# to set the authentication key instead.
#swift_store_key = <None>
{%- if server.storage.swift.store.get('key', False) %}
swift_store_key = {{ server.storage.swift.store.key }}
{% endif %}

#
# Absolute path to the file containing the swift account(s)
Expand All @@ -1862,8 +1872,8 @@ swift_store_key = {{ server.storage.swift.store.key }}
#
# (string value)
#swift_store_config_file = <None>
{% if server.storage.swift.store.config_file is defined %}
swift_store_config_file = {{ server.storage.swift.store.config_file }}
{% if server.storage.swift.store.references is defined %}
Copy link
Member

Choose a reason for hiding this comment

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

can you touch to keep backward compatible, so sth like

if server.storage.swift.store.references is defined
< new code >
else

end

Copy link

Choose a reason for hiding this comment

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

Hi @epcim, change is just reflecting same code block as in glance-api.conf https://github.com/salt-formulas/salt-formula-glance/blame/master/glance/files/ocata/glance-api.conf.Debian#L3221 commit 3a86781 this change was not done in glance-glare.conf which is now causing problems.
I think glance-api.conf and glance-glare.conf should have same code logic.
What do you think?
Thanks.

Copy link

Choose a reason for hiding this comment

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

@LotharKAtt @Martin819 Hi guys, could anyone of you comment or even merge this PR? Thanks a lot.

swift_store_config_file = /etc/glance/swift-stores.conf
{% endif %}

{% endif %}
Expand Down