%PDF- %PDF-
Direktori : /usr/lib/python2.7/site-packages/salt/modules/ |
Current File : //usr/lib/python2.7/site-packages/salt/modules/openscap.pyo |
� ���^c @@ s d Z d d l m Z m Z m Z d d l Z d d l Z d d l Z d d l m Z m Z d d l m Z e Z y d d l Z e j Z e Z Wn e k r� e Z n Xi i d i e d 6f g d 6d d 6d 6Z d � Z d e f d � � YZ i e d 6e d 6e d 6Z d � Z d S( u! Module for OpenSCAP Management i ( t absolute_importt print_functiont unicode_literalsN( t Popent PIPE( t sixu --profileu requiredu parser_argumentsu\ oscap xccdf eval --oval-results --results results.xml --report report.html --profile {0} {1}u cmd_patternu evalc C@ s t d f S( Nu argparse module is required.( t HAS_ARGPARSE( ( ( s9 /usr/lib/python2.7/site-packages/salt/modules/openscap.pyt __virtual__* s t _ArgumentParserc B@ s e Z d d � Z d � Z RS( c O@ sn t t | � j d d | | � | j d d d g �d } x, t d d D] \ } } | j | | � qJ Wd S( Nt progu oscapu actiont choicesu evalu parser_arguments( t superR t __init__t add_argumentt Nonet _XCCDF_MAP( t selft actiont argst kwargst add_argt paramst kwparams( ( s9 /usr/lib/python2.7/site-packages/salt/modules/openscap.pyR 0 s c O@ s t | � � d S( N( t Exception( R t messageR R ( ( s9 /usr/lib/python2.7/site-packages/salt/modules/openscap.pyt error7 s N( t __name__t __module__R R R ( ( ( s9 /usr/lib/python2.7/site-packages/salt/modules/openscap.pyR . s i i c C@ sv t j | � } | d } t } d } d } d } d } yD t � } | j | � d j } t d | � j d | � \ } } Wn( t k r� } t } t j | � } n X| rWt | d j | j | � } t j � } t t j | � d t d t d | �} | j � \ } } t | j } | j } | rWt d | � t j | d t �| } qWn t d | d | d | d | � S( u� Run ``oscap xccdf`` commands on minions. It uses cp.push_dir to upload the generated files to the salt master in the master's minion files cachedir (defaults to ``/var/cache/salt/master/minions/minion-id/files``) It needs ``file_recv`` set to ``True`` in the master configuration file. CLI Example: .. code-block:: bash salt '*' openscap.xccdf "eval --profile Default /usr/share/openscap/scap-yast2sec-xccdf.xml" i����i R R u cmd_patternt stdoutt stderrt cwdu cp.push_dirt ignore_errorst successt upload_dirR t returncodeN( t shlext splitt TrueR R t parse_known_argsR R t FalseR t text_typeR t formatt profilet tempfilet mkdtempR R t communicatet _OSCAP_EXIT_CODES_MAPR"