From 7e39c5bf079d17b74a7ebec3a0a653a75b702684 Mon Sep 17 00:00:00 2001
From: Trishna Guha <trishnaguha17@gmail.com>
Date: Thu, 16 Aug 2018 14:30:47 +0530
Subject: [PATCH] check_mode in nxos_static_route module (#44252)

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
---
 lib/ansible/modules/network/nxos/nxos_static_route.py | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/lib/ansible/modules/network/nxos/nxos_static_route.py b/lib/ansible/modules/network/nxos/nxos_static_route.py
index 7002d8b7c3..ac6da67b98 100644
--- a/lib/ansible/modules/network/nxos/nxos_static_route.py
+++ b/lib/ansible/modules/network/nxos/nxos_static_route.py
@@ -280,13 +280,11 @@ def main():
         candidate = CustomNetworkConfig(indent=3)
         reconcile_candidate(module, candidate, prefix, w)
 
-        if candidate:
+        if not module.check_mode and candidate:
             candidate = candidate.items_text()
             load_config(module, candidate)
             result['commands'].extend(candidate)
             result['changed'] = True
-        else:
-            result['commands'] = []
 
     module.exit_json(**result)