Ansible.Basic.cs - fix check mode run with nested spec (#48838)

This commit is contained in:
Jordan Borean 2018-11-17 18:15:36 +10:00 committed by GitHub
parent a41c0405a7
commit fd4b282f6f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 1 deletions

View file

@ -700,7 +700,8 @@ namespace Ansible.Basic
// initially parse the params and check for unsupported ones and set internal vars
CheckUnsupportedArguments(param, legalInputs);
if (CheckMode && !(bool)spec["supports_check_mode"])
// Only run this check if we are at the root argument (optionsContext.Count == 0)
if (CheckMode && !(bool)spec["supports_check_mode"] && optionsContext.Count == 0)
{
Result["skipped"] = true;
Result["msg"] = String.Format("remote module ({0}) does not support check mode", ModuleName);