Skip to content

Commit 1386cf9

Browse files
authored
Fix password module index entry (#124)
* update module_index entry password so that it matches the structure * updated dict access in order to accept new structure * added fragments
1 parent 8a0a23b commit 1386cf9

File tree

3 files changed

+44
-28
lines changed

3 files changed

+44
-28
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
bugfixes:
3+
- module_index - Password entry now matches configure_function structure.
4+
- system_access_users - Updated set_user_password dict calls in order to work with the newly introduced structure

plugins/module_utils/module_index.py

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,14 @@
107107
"/usr/local/etc/inc/auth.inc",
108108
],
109109
"configure_functions": {
110-
"name": "echo password_hash",
111-
"configure_params": [
112-
"'password'",
113-
"PASSWORD_BCRYPT",
114-
"[ 'cost' => 11 ]",
115-
],
110+
"password": {
111+
"name": "echo password_hash",
112+
"configure_params": [
113+
"'password'",
114+
"PASSWORD_BCRYPT",
115+
"[ 'cost' => 11 ]",
116+
],
117+
},
116118
},
117119
},
118120
"firewall_rules": {
@@ -232,12 +234,14 @@
232234
"/usr/local/etc/inc/auth.inc",
233235
],
234236
"configure_functions": {
235-
"name": "echo password_hash",
236-
"configure_params": [
237-
"'password'",
238-
"PASSWORD_BCRYPT",
239-
"[ 'cost' => 11 ]",
240-
],
237+
"password": {
238+
"name": "echo password_hash",
239+
"configure_params": [
240+
"'password'",
241+
"PASSWORD_BCRYPT",
242+
"[ 'cost' => 11 ]",
243+
],
244+
},
241245
},
242246
},
243247
"firewall_rules": {
@@ -357,12 +361,14 @@
357361
"/usr/local/etc/inc/auth.inc",
358362
],
359363
"configure_functions": {
360-
"name": "echo password_hash",
361-
"configure_params": [
362-
"'password'",
363-
"PASSWORD_BCRYPT",
364-
"[ 'cost' => 11 ]",
365-
],
364+
"password": {
365+
"name": "echo password_hash",
366+
"configure_params": [
367+
"'password'",
368+
"PASSWORD_BCRYPT",
369+
"[ 'cost' => 11 ]",
370+
],
371+
},
366372
},
367373
},
368374
"firewall_rules": {
@@ -483,12 +489,14 @@
483489
"/usr/local/etc/inc/auth.inc",
484490
],
485491
"configure_functions": {
486-
"name": "echo password_hash",
487-
"configure_params": [
488-
"'password'",
489-
"PASSWORD_BCRYPT",
490-
"[ 'cost' => 11 ]",
491-
],
492+
"password": {
493+
"name": "echo password_hash",
494+
"configure_params": [
495+
"'password'",
496+
"PASSWORD_BCRYPT",
497+
"[ 'cost' => 11 ]",
498+
],
499+
},
492500
},
493501
},
494502
"firewall_rules": {

plugins/module_utils/system_access_users_utils.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -775,10 +775,14 @@ def set_user_password(self, user: User) -> None:
775775

776776
# load requirements
777777
php_requirements = self._config_maps["password"]["php_requirements"]
778-
configure_function = self._config_maps["password"]["configure_functions"][
779-
"name"
780-
]
781-
configure_params = self._config_maps["password"]["configure_functions"][
778+
779+
# load requirements
780+
configure_function_dict = self._config_maps["password"]["configure_functions"]
781+
configure_function_key = next(
782+
(key for key in configure_function_dict if key != "name"), None
783+
)
784+
configure_function = configure_function_dict[configure_function_key]["name"]
785+
configure_params = configure_function_dict[configure_function_key][
782786
"configure_params"
783787
]
784788

0 commit comments

Comments
 (0)