mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix bug #42936 - win_iis module
Fix set_container_setting by adding map from string to numeric and vice versa.
This commit is contained in:
parent
7b0c94768a
commit
13404a47b5
1 changed files with 11 additions and 0 deletions
|
@ -1255,6 +1255,9 @@ def set_container_setting(name, container, settings):
|
|||
salt '*' win_iis.set_container_setting name='MyTestPool' container='AppPools'
|
||||
settings="{'managedPipeLineMode': 'Integrated'}"
|
||||
'''
|
||||
|
||||
identityType_map2string = {'0': 'LocalSystem', '1': 'LocalService', '2': 'NetworkService', '3': 'SpecificUser', '4': 'ApplicationPoolIdentity'}
|
||||
identityType_map2numeric = {'LocalSystem': '0', 'LocalService': '1', 'NetworkService': '2', 'SpecificUser': '3', 'ApplicationPoolIdentity': '4'}
|
||||
ps_cmd = list()
|
||||
container_path = r"IIS:\{0}\{1}".format(container, name)
|
||||
|
||||
|
@ -1281,6 +1284,10 @@ def set_container_setting(name, container, settings):
|
|||
except ValueError:
|
||||
value = "'{0}'".format(settings[setting])
|
||||
|
||||
# Map to numeric to support server 2008
|
||||
if (setting == 'processModel.identityType' and settings[setting] in identityType_map2numeric.keys()):
|
||||
value = identityType_map2numeric[settings[setting]]
|
||||
|
||||
ps_cmd.extend(['Set-ItemProperty',
|
||||
'-Path', "'{0}'".format(container_path),
|
||||
'-Name', "'{0}'".format(setting),
|
||||
|
@ -1300,6 +1307,10 @@ def set_container_setting(name, container, settings):
|
|||
failed_settings = dict()
|
||||
|
||||
for setting in settings:
|
||||
# map identity type from numeric to string for comparing
|
||||
if (setting == 'processModel.identityType' and settings[setting] in identityType_map2string.keys()):
|
||||
settings[setting] = identityType_map2string[settings[setting]]
|
||||
|
||||
if str(settings[setting]) != str(new_settings[setting]):
|
||||
failed_settings[setting] = settings[setting]
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue