mirror of
https://github.com/ansible/awx.git
synced 2026-03-26 13:25:02 -02:30
Remove len() check
Remove comment Remove quote marks from default values
This commit is contained in:
@@ -48,14 +48,14 @@ options:
|
|||||||
- User is a system wide administrator.
|
- User is a system wide administrator.
|
||||||
required: False
|
required: False
|
||||||
type: bool
|
type: bool
|
||||||
default: 'False'
|
default: False
|
||||||
aliases: ['superuser']
|
aliases: ['superuser']
|
||||||
is_system_auditor:
|
is_system_auditor:
|
||||||
description:
|
description:
|
||||||
- User is a system wide auditor.
|
- User is a system wide auditor.
|
||||||
required: False
|
required: False
|
||||||
type: bool
|
type: bool
|
||||||
default: 'False'
|
default: False
|
||||||
aliases: ['auditor']
|
aliases: ['auditor']
|
||||||
password:
|
password:
|
||||||
description:
|
description:
|
||||||
@@ -126,31 +126,20 @@ def main():
|
|||||||
first_name=dict(required=False, type='str'),
|
first_name=dict(required=False, type='str'),
|
||||||
last_name=dict(required=False, type='str'),
|
last_name=dict(required=False, type='str'),
|
||||||
email=dict(required=False, type='str'),
|
email=dict(required=False, type='str'),
|
||||||
is_superuser=dict(required=False, type='bool', default='False', aliases=['superuser']),
|
is_superuser=dict(required=False, type='bool', default=False, aliases=['superuser']),
|
||||||
is_system_auditor=dict(required=False, type='bool', default='False', aliases=['auditor']),
|
is_system_auditor=dict(required=False, type='bool', default=False, aliases=['auditor']),
|
||||||
password=dict(required=False, type='str', default=''),
|
password=dict(required=False, type='str', default=''),
|
||||||
state=dict(choices=['present', 'absent'], default='present'),
|
state=dict(choices=['present', 'absent'], default='present'),
|
||||||
)
|
)
|
||||||
|
|
||||||
# TODO: Implement a way to also generate proper aliases for backwards compatibility
|
|
||||||
# and also add the aliases to documentation!
|
|
||||||
|
|
||||||
# Create a module for ourselves
|
# Create a module for ourselves
|
||||||
module = TowerModule(argument_spec=argument_spec, supports_check_mode=True)
|
module = TowerModule(argument_spec=argument_spec, supports_check_mode=True)
|
||||||
|
|
||||||
# Extract our parameters
|
# Extract our parameters
|
||||||
username = module.params.get('username')
|
username = module.params.get('username')
|
||||||
if username and len(username) > 150:
|
|
||||||
module.fail_msg(msg="The value for username can not be longer than 150")
|
|
||||||
first_name = module.params.get('first_name')
|
first_name = module.params.get('first_name')
|
||||||
if first_name and len(first_name) > 30:
|
|
||||||
module.fail_msg(msg="The value for first_name can not be longer than 30")
|
|
||||||
last_name = module.params.get('last_name')
|
last_name = module.params.get('last_name')
|
||||||
if last_name and len(last_name) > 150:
|
|
||||||
module.fail_msg(msg="The value for last_name can not be longer than 150")
|
|
||||||
email = module.params.get('email')
|
email = module.params.get('email')
|
||||||
if email and len(email) > 254:
|
|
||||||
module.fail_msg(msg="The value for email can not be longer than 254")
|
|
||||||
is_superuser = module.params.get('is_superuser')
|
is_superuser = module.params.get('is_superuser')
|
||||||
is_system_auditor = module.params.get('is_system_auditor')
|
is_system_auditor = module.params.get('is_system_auditor')
|
||||||
password = module.params.get('password')
|
password = module.params.get('password')
|
||||||
|
|||||||
Reference in New Issue
Block a user