|
11 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12 | 12 | # See the License for the specific language governing permissions and
|
13 | 13 | # limitations under the License.
|
14 |
| -from typing import Any, Optional, get_type_hints |
| 14 | +from typing import Optional, get_type_hints |
15 | 15 |
|
16 | 16 | from django.core.exceptions import ImproperlyConfigured
|
17 | 17 | from dynaconf import Dynaconf
|
18 |
| -from dynaconf.utils.functional import empty |
19 | 18 |
|
20 | 19 | from aap_eda import utils
|
21 | 20 | from aap_eda.core.enums import RulebookProcessLogLevel
|
@@ -85,28 +84,6 @@ def _get_url_end_slash(settings: Dynaconf, name: str) -> str:
|
85 | 84 | return value
|
86 | 85 |
|
87 | 86 |
|
88 |
| -def toggle_feature_flags(settings: Dynaconf) -> dict[str, Any]: |
89 |
| - """Toggle FLAGS based on installer settings. |
90 |
| -
|
91 |
| - FLAGS is a django-flags formatted dictionary. |
92 |
| - FLAGS={ |
93 |
| - "FEATURE_SOME_PLATFORM_FLAG_ENABLED": [ |
94 |
| - {"condition": "boolean", "value": False, "required": True}, |
95 |
| - {"condition": "before date", "value": "2022-06-01T12:00Z"}, |
96 |
| - ] |
97 |
| - } |
98 |
| - Installers will place `FEATURE_SOME_PLATFORM_FLAG_ENABLED=True/False` in |
99 |
| - the settings file. This function will update the value in the index 0 in |
100 |
| - FLAGS with the installer value. |
101 |
| - """ |
102 |
| - data = {} |
103 |
| - for feature_name, feature_content in settings.get("FLAGS", {}).items(): |
104 |
| - if (installer_value := settings.get(feature_name, empty)) is not empty: |
105 |
| - feature_content[0]["value"] = installer_value |
106 |
| - data[f"FLAGS__{feature_name}"] = feature_content |
107 |
| - return data |
108 |
| - |
109 |
| - |
110 | 87 | # Database
|
111 | 88 | # https://docs.djangoproject.com/en/4.1/ref/settings/#databases
|
112 | 89 |
|
@@ -433,12 +410,3 @@ def post_loading(loaded_settings: Dynaconf):
|
433 | 410 | if key not in loaded_settings or settings[key] != loaded_settings[key]
|
434 | 411 | }
|
435 | 412 | loaded_settings.update(data, loader_identifier="settings:post_loading")
|
436 |
| - |
437 |
| - # toggle feature flags, considering flags coming from |
438 |
| - # /etc/ansible-automation-platform/*.yaml |
439 |
| - # and envvars like `EDA_FEATURE_FOO_ENABLED=true |
440 |
| - loaded_settings.update( |
441 |
| - toggle_feature_flags(settings), |
442 |
| - loader_identifier="settings:toggle_feature_flags", |
443 |
| - merge=True, |
444 |
| - ) |
0 commit comments