HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //opt/alt/python37/lib/python3.7/site-packages/ssa/ssa_utils/__pycache__/validations.cpython-37.pyc
B

V�d
�@s�dZddlZddlmZddlmZmZmZmZm	Z	m
Z
ddlmZedee
dd	�d
d�ed�eed
d	��dd	�dd�ed�eedd	��dd	�dd�ed�eedd	��dd	�dd�ed�eedd	��dd	�dd�ed�eedd	��dd	�dd�ed �eed!d	��d"d	�d#d�ed$�eed%d	��d&d	�d'd�ed(�ed)d	��ed*�eed+d	��d,d	�d-d�i
�Zedee
d.d	�d/d�ed0�e
e
d�ed1�eed2�ei�Zeed3�d4d5�Zeed6�d7d8�ZdS)9zF
This module contains validation schema for config file loaded values
�N)�	Namespace)�Schema�And�Optional�Use�SchemaError�Or�)�SSAError�commandcCs|dkS)N)z
set-configz
get-configzget-ssa-statusz
get-reportz
enable-ssazdisable-ssazget-stat�)�crr�J/opt/alt/python37/lib/python3.7/site-packages/ssa/ssa_utils/validations.py�<lambda>�rzInvalid command)�errorZdomains_numbercCst|�S)N)�int)�nrrrrrcCs|dkS)Nrr)rrrrrrz.number of domains should be a positive integerZurls_numbercCst|�S)N)r)rrrrrrcCs|dkS)Nrr)rrrrrrz+number of URLs should be a positive integerZrequests_durationcCst|�S)N)�float)rrrrrrcCs|dkS)Ngr)rrrrr rz#request duration should be positiveZrequest_numbercCst|�S)N)r)rrrrr"rcCs|dkS)Nrr)rrrrr#rz/number of requests should be a positive integer�timecCst|�S)N)r)rrrrr%rcCsd|kodkSS)Nr�r)rrrrr&rz8time should be a positive integer between 1 and 12, or 0ZcorrelationcCs|��S)N)�
capitalize)�srrrr(rcCs|dkS)N)�On�Offr)rrrrr(rz*bad correlation value, should be On or OffZcorrelation_coefficientcCst|�S)N)r)rrrrr*rcCsd|kodkSS)Ngg�?r)rrrrr+rz?correlation coefficient could not be negative or greater than 1Zignore_listcCst|�S)N)�str)rrrrr-rZsummary_notification_enabledcCs|��S)N)r)rrrrr/rcCs|dkS)N)rrr)rrrrr/rz+bad notification value, should be On or OffcCs|dkS)N)�enable�disable�statusr)r
rrrr5rzInvalid autotracing command�user�allZ
list_disabled)�data�returnc
CsZy t�|�}|d}|d=||fStk
rT}ztdt|�����Wdd}~XYnXdS)zs
    Validate given data.
    Return:  tuple with 2 elements: command string and list of the validated options
    rzInvalid configuration: N)�cmdline_schema�validaterr
r)r!�d�cmd�errrr$=s
r$)�
input_argsr"c
CsTytft�|��Stk
rN}z tt�ddt|���i���Wdd}~XYnXdS)z�
    Validate given input with schema
    Input arguments expected in s dict form
    :param input_args: dict with input data
    �resultzInput validation error: N)r�autotracing_cmdline_schemar$r�
SystemExit�json�dumpsr)r(r'rrr�validate_autotracingKs
r.)�__doc__r,�argparserZschemarrrrrr�internal.exceptionsr
rr#�boolr*�dict�tupler$r.rrrr�<module>
sN