Commit 375414a
authored
fix: Move the
The `AWS_NORMALIZER` configuration is used for both the storage and result
storage modules, but there's no requirement to use the storage module if you
only need the result storage module. In that case, you might have the storage
module configured with:
```
STORAGE = "thumbor.storages.no_storage"
```
In that case, the `thumbor_aws.storage` file is never loaded, which means the
`AWS_NORMALIZER` configuration never gets defined, which in turn means any
requests for the result storage module which tries to call `normalize_path`
will fail with an error like this:
```
2025-08-26 08:08:38 thumbor:ERROR [BaseHander.execute_image_operations] AWS_NORMALIZER
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/thumbor/handlers/__init__.py", line 145, in execute_image_operations
result = await self.context.modules.result_storage.get()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/thumbor_aws/result_storage.py", line 168, in get
file_abspath = normalize_path(self.context, self.prefix, path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/thumbor_aws/utils.py", line 9, in normalize_path
new_path = context.config.AWS_NORMALIZER(path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/derpconf/config.py", line 225, in __getattr__
raise AttributeError(name)
AttributeError: AWS_NORMALIZER
```
This fixes that by moving the configuration setting to the top-level config
file to make sure it's always defined, regardless of if `thumbor_aws.storage`
is used or not.AWS_NORMALIZER config to top-level configuration list (#316)1 parent 027d11c commit 375414a
2 files changed
+8
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
124 | 125 | | |
125 | 126 | | |
126 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
127 | 135 | | |
128 | 136 | | |
129 | 137 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
| |||
70 | 69 | | |
71 | 70 | | |
72 | 71 | | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | 72 | | |
81 | 73 | | |
82 | 74 | | |
| |||
0 commit comments