Skip to content

Commit

Permalink
module_utils.modules: expose module.params as a readonly dict
Browse files Browse the repository at this point in the history
Use a MappingProxyType without backend to ensure the `module.params`
dict is readonly.
  • Loading branch information
goneri authored and tremble committed Jan 10, 2023
1 parent 3082fa6 commit 06142c4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugins/module_utils/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
import os
import re
import traceback
from types import MappingProxyType

try:
from cStringIO import StringIO
Expand Down Expand Up @@ -163,7 +164,7 @@ def __init__(self, **kwargs):

@property
def params(self):
return self._module.params
return MappingProxyType(self._module.params)

def _get_resource_action_list(self):
actions = []
Expand Down

0 comments on commit 06142c4

Please sign in to comment.