Your IP : 18.219.119.163
3
���fk � @ s� d dl mZ d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dl Z d dl
mZ dZd dl
mZmZmZmZmZmZ dd� Zddd �Zd
d� Zdd
� ZdS )� )�print_functionN)�defaultdictz
dnssec-keymgr)�dnskey�keydict� keyseries�policy�parsetab�utilsc O s t | |� tjd� d S )N� )�print�sys�exit)�args�kwargs� r �/usr/lib/python3.6/keymgr.py�fatal s
r c C s� |}| s(t jj|� s(t j|t j� r�t jd }|s>t jj}xB|jt j�D ]2}|t j | }t jj|�rzt j|t j�rzP d}qLW |S )a2 find the location of a specified command. If a default is supplied,
exists and it's an executable, we use it; otherwise we search PATH
for an alternative.
:param command: command to look for
:param default: default value to use
:return: PATH with the location of a suitable binary
�PATHN)
�os�path�isfile�access�X_OK�environ�defpath�split�pathsep�sep)Zcommand�defaultZfpathr Z directoryr r r �set_path s $
r c C s� t dtjjtjd�d��} t dtjjtjd�d��}tjtd d�}|j dt
ddd;d� |j dd
t
ddd� |j ddt
ddd� |j dd| t
dd
d� |j ddt
ddd
d� |j dd|t
dd
d� |j d d!d"d#d$d%� |j d&d'd"d#d(d%� |j d)d*d+d"d#d<d%� |j d.d/d0d"d#d1d%� |j d2d3d4tjd5� |j� }|j
�rJ|j�rJtd6� |jdk�r^td7� |jdk�rrtd8� |jdk �r�tjj|j��s�td9|j � n(tjjtjd:�|_tjj|j��s�d|_|S )=zc Read command line arguments, returns 'args' object
:return: args object properly prepared
z
dnssec-keygenZsbinzdnssec-settimezA: schedule DNSSEC key rollovers according to a pre-defined policy)�description�zone�*Nz.Zone(s) to which the policy should be applied z%(default: all zones in the directory))�type�nargsr �helpz-Kr zDirectory containing keys�dir)�destr# r% �metavarz-c�
policyfilezPolicy definition file�filez-g�keygenzPath to 'dnssec-keygen')r'