Skip to content

Commit 6fcdeaa

Browse files
committed
swift: fix credentials
swiftclient is not supposed to get the connection options prefixed with "os_", and I don't see value in keeping that now that the data struct has been reworked.
1 parent 509759f commit 6fcdeaa

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

charm/tests/conftest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,9 @@ def error_tracker_config(
166166
}}
167167
168168
swift_creds = {{
169-
"os_auth_url": "{swift["os_auth_url"]}",
170-
"os_username": "{swift["os_username"]}",
171-
"os_password": "{swift["os_password"]}",
169+
"auth_url": "{swift["os_auth_url"]}",
170+
"username": "{swift["os_username"]}",
171+
"password": "{swift["os_password"]}",
172172
"auth_version": "{swift["auth_version"]}",
173173
}}
174174
"""

src/errortracker/config.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,18 @@
3030

3131
# Example:
3232
# swift_creds = {
33-
# "os_auth_url": "http://keystone.example.com/",
34-
# "os_username": "ostack",
35-
# "os_password": "secret",
36-
# "os_tenant_name": "ostack_project",
37-
# "os_region_name": "region01",
33+
# "auth_url": "http://keystone.example.com/",
34+
# "username": "ostack",
35+
# "password": "secret",
36+
# "tenant_name": "ostack_project",
37+
# "region_name": "region01",
3838
# "auth_version": "3.0",
3939
# }
4040
# Default value is good for local dev with saio
4141
swift_creds = {
42-
"os_auth_url": "http://127.0.0.1:8080/auth/v1.0",
43-
"os_username": "test:tester",
44-
"os_password": "testing",
42+
"auth_url": "http://127.0.0.1:8080/auth/v1.0",
43+
"username": "test:tester",
44+
"password": "testing",
4545
"auth_version": "1.0",
4646
}
4747

src/errortracker/swift_utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ def get_swift_client():
1111
return _client
1212

1313
opts = {}
14-
for key in ["os_region_name", "os_tenant_name"]:
14+
for key in ["region_name", "tenant_name"]:
1515
if key in config.swift_creds:
1616
opts[key] = config.swift_creds[key]
1717

1818
_client = swiftclient.client.Connection(
19-
config.swift_creds["os_auth_url"],
20-
config.swift_creds["os_username"],
21-
config.swift_creds["os_password"],
19+
config.swift_creds["auth_url"],
20+
config.swift_creds["username"],
21+
config.swift_creds["password"],
2222
os_options=opts,
2323
auth_version=config.swift_creds["auth_version"],
2424
)

0 commit comments

Comments
 (0)