Merge "Add a warning message for the list of unused parameters"

This commit is contained in:
Jenkins 2017-09-01 05:05:13 +00:00 committed by Gerrit Code Review
commit db19ce4400
2 changed files with 14 additions and 0 deletions

View File

@ -0,0 +1,5 @@
---
features:
- |
Added a warning message to provide the list of parameters which are
not used in a deployment plan, but provided by the user via environments.

View File

@ -117,14 +117,23 @@ def check_deprecated_parameters(clients, container):
messages = base.wait_for_messages(workflow_client, ws, execution, 120)
deprecated_params = []
unused_params = []
for message in messages:
if message['status'] == 'SUCCESS':
for param in message.get('deprecated', []):
if param.get('user_defined'):
deprecated_params.append(param['parameter'])
unused_params = message.get('unused', [])
if deprecated_params:
print('WARNING: Following parameters are deprecated and still '
'defined. Deprecated parameters will be removed soon!')
print('\n'.join([' {}'.format(param)
for param in deprecated_params]))
if unused_params:
print('WARNING: Following parameters are defined but not used in '
'plan. Could be possible that parameter is valid but '
'currently not used.')
print('\n'.join([' {}'.format(param)
for param in unused_params]))