From 56120433c96dec9736a2dcda04efcb355168a21b Mon Sep 17 00:00:00 2001 From: Peter Sprygada Date: Tue, 4 Oct 2016 16:21:50 -0400 Subject: [PATCH] checks commit comment to make sure it doesn't exceed 60 characters (#5155) The comment argument can be at most 60 characters per the IOS XR command line. If a comment is > 60 characters, the module will now gracefully error and return a well formed message. fixes 5146 --- lib/ansible/modules/network/iosxr/iosxr_config.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/ansible/modules/network/iosxr/iosxr_config.py b/lib/ansible/modules/network/iosxr/iosxr_config.py index 0dc6984fc48..15978ff108b 100644 --- a/lib/ansible/modules/network/iosxr/iosxr_config.py +++ b/lib/ansible/modules/network/iosxr/iosxr_config.py @@ -194,6 +194,9 @@ DEFAULT_COMMIT_COMMENT = 'configured by iosxr_config' def check_args(module, warnings): + if module.params['comment']: + if len(module.params['comment']) > 60: + module.fail_json(msg='comment argument cannot be more than 60 characters') if module.params['force']: warnings.append('The force argument is deprecated, please use ' 'match=none instead. This argument will be '