mirror of
https://github.com/ansible/awx.git
synced 2026-05-20 07:17:40 -02:30
Merge pull request #6928 from jangsutsr/6904_strengthen_attribute_check_for_tower_conf_validators
Strengthen attribute check for Tower configuration validations
This commit is contained in:
@@ -472,7 +472,9 @@ register(
|
||||
|
||||
|
||||
def logging_validate(serializer, attrs):
|
||||
if not serializer.instance:
|
||||
if not serializer.instance or \
|
||||
not hasattr(serializer.instance, 'LOG_AGGREGATOR_HOST') or \
|
||||
not hasattr(serializer.instance, 'LOG_AGGREGATOR_TYPE'):
|
||||
return attrs
|
||||
errors = []
|
||||
if attrs.get('LOG_AGGREGATOR_ENABLED', False):
|
||||
|
||||
@@ -1089,7 +1089,9 @@ register(
|
||||
|
||||
|
||||
def tacacs_validate(serializer, attrs):
|
||||
if not serializer.instance:
|
||||
if not serializer.instance or \
|
||||
not hasattr(serializer.instance, 'TACACSPLUS_HOST') or \
|
||||
not hasattr(serializer.instance, 'TACACSPLUS_SECRET'):
|
||||
return attrs
|
||||
errors = []
|
||||
host = serializer.instance.TACACSPLUS_HOST
|
||||
|
||||
Reference in New Issue
Block a user