diff --git a/lib/ansible/modules/network/junos/junos_logging.py b/lib/ansible/modules/network/junos/junos_logging.py index 06c6343e63..1be8e3436c 100644 --- a/lib/ansible/modules/network/junos/junos_logging.py +++ b/lib/ansible/modules/network/junos/junos_logging.py @@ -217,12 +217,14 @@ def main(): param_to_xpath_map.update([ ('name', {'xpath': 'name', 'is_key': True, 'top': dest}), ('facility', {'xpath': 'name', 'is_key': is_facility_key, 'top': field_top}), - ('level', {'xpath': module.params.get('level'), 'tag_only': True, 'top': field_top}), ('size', {'xpath': 'size', 'leaf_only': True, 'is_key': True, 'top': 'archive'}), ('files', {'xpath': 'files', 'leaf_only': True, 'is_key': True, 'top': 'archive'}), ('rotate_frequency', {'xpath': 'log-rotate-frequency', 'leaf_only': True}), ]) + if module.params.get('level'): + param_to_xpath_map['level'] = {'xpath': module.params.get('level'), 'tag_only': True, 'top': field_top} + validate_param_values(module, param_to_xpath_map) want = map_params_to_obj(module, param_to_xpath_map)