Edit File: run_autotracing.cpython-37.pyc
B V�dy � @ s� d Z ddlZddlZddlZddlmZmZ ddlmZ ddl m Z mZmZm Z ddlmZ dd lmZ dd lmZ edd�dd �Zdd�dd�ZdS )z< This module contains Autotracing utility main run function � N� )�cmd_parser_autotracing_util�parse_cmd_arguments)�validate_autotracing� )�enable�disable�status�disabled_users)�autotracing_log)�SSAError)�configure_logging)�msg�returnc K s2 d| i}|� dd� |�� D �� tt�|�� dS )z Pack response�resultc S s i | ]\}}|d k r||�qS )N� )�.0�k�vr r �N/opt/alt/python37/lib/python3.7/site-packages/ssa/ssa_utils/run_autotracing.py� <dictcomp> s zresponse.<locals>.<dictcomp>N)�update�items�print�json�dumps)r �kwargsZinitialr r r �response s r )r c C s� t �� } tt� tt� �}t|j�}|jdkr�|j rL|j rLtd� t� d� | dkrt|j s�|j s�td� t� d� n|j s�|j r�td� t� d� |jdkr�|jr�|j r�td� t� d� y�|jd kr�t|j |j �}td |d� n�|jdk�rt|j |j � td � n`|jdk�rft|j �\}}|j�rX| dk�rDtd � t� d� td |t� |d� ntd ||d� W n6 tk �r� } zt|� t� d� W dd}~X Y nX dS )z Main run function )r r z+--all and username are not allowed togetherr r z*either --all or username must be specifiedz&neither --all nor username are allowedr z5--list_disabled and username are not allowed togetherr Zsuccess)�malfunctionr z--list-disabled is not allowed)r r r )r r N)�os�getuidr r r r r �__dict__Zcommand�all�userr �sys�exitZ list_disabledr r r r r r )Zcurrent_uid�argsZvalidated_argsZissueZcurrent_status�er r r �run! sP r( )�__doc__r r r$ Zcmdline_parserr r Zvalidationsr Zautotracingr r r r Zinternal.constantsr Zinternal.exceptionsr Zinternal.utilsr �strr r( r r r r �<module> s