From d696030293b473a5c0292c618dc0d6e88c299100 Mon Sep 17 00:00:00 2001 From: James Slagle Date: Mon, 16 Apr 2018 11:41:03 -0400 Subject: [PATCH] Suppress warnings with -qq The quiet arg (-q) is cumulative and should suppress warnings when -qq is specified per the help text. These warnings were previously added and did not honor -qq. Depends-On: I0cf206e8ceeecfca17dd99a83b8c2eaa50e66712 Change-Id: Ic9fe4d7934fa6ad9c4d689a5402f43231c245ada --- tools/yaml-validate.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/yaml-validate.py b/tools/yaml-validate.py index a7e214f813..5b64f56056 100755 --- a/tools/yaml-validate.py +++ b/tools/yaml-validate.py @@ -675,7 +675,8 @@ def validate(filename, param_map): ) ) return 1 - if tpl_template_version != current_heat_template_version: + if tpl_template_version != current_heat_template_version \ + and args.quiet < 2: print('Warning: heat_template_version in template %s ' 'is outdated: %s (current %s)' % ( @@ -790,7 +791,8 @@ def validate_upgrade_tasks(upgrade_tasks): print('ERROR: \'step|int ==\' condition should be evaluated first in when conditions for task (%s)' % (task)) return 1 else: - if (' and ' in whenline) and (' or ' not in whenline): + if (' and ' in whenline) and (' or ' not in whenline) \ + and args.quiet < 2: print("Warning: Consider specifying \'and\' conditions as a list to improve readability in task: \"%s\"" % (task_name)) return 0