Fixes #4506 test length of context before checking invalid indexes
This commit is contained in:
parent
f347133d85
commit
74e7eba528
1 changed files with 6 additions and 4 deletions
|
@ -348,10 +348,12 @@ class AnsibleModule(object):
|
||||||
# argument context, which may have selevel.
|
# argument context, which may have selevel.
|
||||||
|
|
||||||
for i in range(len(cur_context)):
|
for i in range(len(cur_context)):
|
||||||
if context[i] is not None and context[i] != cur_context[i]:
|
if len(context) > i:
|
||||||
new_context[i] = context[i]
|
if context[i] is not None and context[i] != cur_context[i]:
|
||||||
if context[i] is None:
|
new_context[i] = context[i]
|
||||||
new_context[i] = cur_context[i]
|
if context[i] is None:
|
||||||
|
new_context[i] = cur_context[i]
|
||||||
|
|
||||||
if cur_context != new_context:
|
if cur_context != new_context:
|
||||||
try:
|
try:
|
||||||
if self.check_mode:
|
if self.check_mode:
|
||||||
|
|
Loading…
Reference in a new issue