MOON
Server: Apache
System: Linux server2.shieldcogroup.com 3.10.0-1160.119.1.el7.tuxcare.els12.x86_64 #1 SMP Fri Nov 8 05:49:38 UTC 2024 x86_64
User: jacom (1029)
PHP: 8.1.34
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib/python2.7/site-packages/leapp/utils/audit/__init__.pyc
�
9�Egc@s$ddlmZddlZddlZddlZddlZddlZddlmZddl	m
Z
ddlmZm
Z
ed��Zd�Zd�Zd	�Zd
efd��YZdefd
��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdd �Zd!�Z d"efd#��YZ!d$�Z"d%Z#dd&�Z$d'Z%d(�Z&d)�Z'd*�Z(d+�Z)d,�Z*d-�Z+dS(.i����(tcontextmanagerN(t
get_config(tstring_types(tCURRENT_SCHEMAt
MIGRATIONSccs%tj|�}dVtj|�dS(N(tostumask(tnew_masktcur_mask((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pyt_umask
scCs�|jd�j�d}|s/|jt�n�|jd�j�d}gtD]}|d^qO}y|j|�}Wntk
r�n'Xx#t|D]}|j|d�q�Wtjj	d�r�|jd�|jd�n|S(s�
    Checks that the latest schema of the database has been applied or initializes the database
    for new databases

    :param db: Connection object to the database
    :return: Pass through of the db object for convenience
    sPRAGMA schema_versionisPRAGMA user_versionitLEAPP_DEVEL_DATABASE_SYNC_OFFsPRAGMA journal_mode = WALsPRAGMA synchronous = 0(
texecutetfetchonet
executescriptRRtindext
ValueErrorRtenvirontget(tdbtschema_versiontuser_versiontmtversionsRt	migration((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pyt_initialize_databases

cCs*td��ttj|��SWdQXdS(s�
    Creates a database connection to the path and ensures it's initialized and up to date.

    :param path: Path to the database
    :return: Connection object
    iN(R	Rtsqlite3tconnect(tpath((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pytcreate_connection5s
cCs)|r
|St�}t|jdd��S(s�
    Get the database connection or passes it through if it is already set

    :param db: Database connection to be passed through in case it exists already
    :return: database object initialized and migrated to the latest schema version
    tdatabaseR(RRR(Rtcfg((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pytget_connection@s	tStorablecBs#eZdZdd�Zd�ZRS(s+
    Base class for database storables
    cCs&t|��}|j|�WdQXdS(sz
        Stores the data within a transaction
        :param db: Database object (optional)
        :return: None
        N(Rtdo_store(tselfRt
connection((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pytstoreRscCsdS(s�
        Performs the actual storing of the data

        :param connection: Database connection to use (Can be a transaction cursor)
        :return: None
        N((R"R#((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pyR![sN(t__name__t
__module__t__doc__tNoneR$R!(((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pyR Ms	t	ExecutioncBs;eZdZed��Zddddd�Zd�ZRS(s8
    Stores information about the current execution
    cCs|jS(sy
        Returns the id of the entry, which is only set when already stored.
        :return: Integer id or None
        (t
_execution_id(R"((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pytexecution_idiscCs�tt|�j�|p/tjj�j�d|_t|t�s\t	j
|dt�}n||_||_
||_d|_dS(sy
        :param context: Execution context identifier
        :type context: str
        :param kind: Execution kind - Can be any string and used for filtering
        :type kind: str
        :param configuration:
        :type configuration: str, dict, list or tuple
        :param stamp: Timestamp string of the execution start in iso format
        :type stamp: str
        tZt	sort_keysN(tsuperR)t__init__tdatetimetutcnowt	isoformattstampt
isinstanceRtjsontdumpstTruet
configurationtcontexttkindR(R*(R"R9R:R8R3((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pyR/qs"			cCsmtt|�j|�|jd|j|j|j|jf�|jd|jf�}|j�d|_	dS(NsXINSERT OR IGNORE INTO execution (context, configuration, stamp, kind) VALUES(?, ?, ?, ?)s*SELECT id FROM execution WHERE context = ?i(
R.R)R!RR9R8R3R:RR*(R"R#tcursor((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pyR!�s		N(R%R&R'tpropertyR+R(R/R!(((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pyR)dstHostcBs5eZdZddd�Zed��Zd�ZRS(s
    Host information
    cCs||_||_d|_dS(N(R9thostnameR(t_host_id(R"R9R>((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pyR/�s		cCs|jS(sy
        Returns the id of the entry, which is only set when already stored.
        :return: Integer id or None
        (R?(R"((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pythost_id�scCsgtt|�j|�|jd|j|jf�|jd|j|jf�}|j�d|_dS(Ns;INSERT OR IGNORE INTO host (context, hostname) VALUES(?, ?)s6SELECT id FROM host WHERE context = ? AND hostname = ?i(R.R=R!RR9R>RR?(R"R#R;((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pyR!�s		N(R%R&R'R(R/R<R@R!(((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pyR=�stMessageDatacBs&eZdZddd�Zd�ZRS(s
    Message data
    cCs)tt|�j�||_||_dS(s�
        :param data: Message payload
        :type data: str
        :param hash_id: SHA256 hash in hexadecimal representation of data
        :type hash_id: str
        N(R.RAR/tdatathash_id(R"RBRC((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pyR/�s	cCs6tt|�j|�|jd|j|jf�dS(Ns<INSERT OR IGNORE INTO message_data (hash, data) VALUES(?, ?)(R.RAR!RRCRB(R"R#((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pyR!�sN(R%R&R'R(R/R!(((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pyRA�st
DataSourcecBs5eZddddd�Zed��Zd�ZRS(cCs>tt|�jd|d|�||_||_d|_dS(s�
        :param actor: Name of the actor that triggered the entry
        :type actor: str
        :param phase: In which phase of the workflow execution the data entry was created
        :type phase: str
        :param context: The execution context
        :type context: str
        :param hostname: Hostname of the system that produced the entry
        :type hostname: str
        R9R>N(R.RDR/tactortphaseR(t_data_source_id(R"RERFR9R>((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pyR/�s		cCs|jS(sy
        Returns the id of the entry, which is only set when already stored.
        :return: Integer id or None
        (RG(R"((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pytdata_source_id�scCstt|�j|�|jd|j|j|j|jf�|jd|j|j|j|jf�}|j�d|_	dS(NsUINSERT OR IGNORE INTO data_source (context, host_id, actor, phase) VALUES(?, ?, ?, ?)sXSELECT id FROM data_source WHERE context = ? AND host_id = ? AND actor = ? AND phase = ?i(
R.RDR!RR9R@RERFRRG(R"R#R;((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pyR!�s	!N(R%R&R(R/R<RHR!(((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pyRD�stActorConfigDatacBs&eZdZddd�Zd�ZRS(s"
    Actor configuration data
    cCs)tt|�j�||_||_dS(s�
        :param config: Actor configuration
        :type config: str
        :param hash_id: SHA256 hash in hexadecimal representation of config
        :type hash_id: str
        N(R.RIR/tconfigRC(R"RJRC((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pyR/�s	cCs6tt|�j|�|jd|j|jf�dS(NsCINSERT OR IGNORE INTO actor_config_data (hash, config) VALUES(?, ?)(R.RIR!RRCRJ(R"R#((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pyR!�sN(R%R&R'R(R/R!(((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pyRI�stActorConfigcBs5eZdZddd�Zed��Zd�ZRS(s
    Actor configuration
    cCs2tt|�j�||_||_d|_dS(s�
        :param context: The execution context
        :type context: str
        :param config: Actor configuration
        :type config: :py:class:`leapp.utils.audit.ActorConfigData`
        N(R.RKR/R9RJR(t_actor_config_id(R"R9RJ((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pyR/�s		cCs|jS(sy
        Returns the id of the entry, which is only set when already stored.
        :return: Integer id or None
        (RL(R"((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pytactor_config_id
scCs}tt|�j|�|jj|�|jd|j|jjf�|jd|j|jjf�}|j�d|_dS(NsLINSERT OR IGNORE INTO actor_config (context, actor_config_hash) VALUES(?, ?)sGSELECT id FROM actor_config WHERE context = ? AND actor_config_hash = ?i(	R.RKR!RJRR9RCRRL(R"R#R;((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pyR!sN(R%R&R'R(R/R<RMR!(((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pyRK�stMetadatacBs&eZdZddd�Zd�ZRS(s
    Metadata of an Entity
    cCs)tt|�j�||_||_dS(s�
        :param metadata: Entity metadata
        :type metadata: str
        :param hash_id: SHA256 hash in hexadecimal representation of data
        :type hash_id: str
        N(R.RNR/tmetadataRC(R"RORC((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pyR/#s	cCs6tt|�j|�|jd|j|jf�dS(Ns<INSERT OR IGNORE INTO metadata (hash, metadata) VALUES(?, ?)(R.RNR!RRCRO(R"R#((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pyR!.s	N(R%R&R'R(R/R!(((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pyRNstEntitycBs>eZdZdddddd�Zed��Zd�ZRS(s7
    Leapp framework entity (e.g. actor, workflow)
    cCsGtt|�jd|d|�||_||_||_d|_dS(s�
        :param context: The execution context
        :type context: str
        :param hostname: Hostname of the system that produced the entry
        :type hostname: str
        :param kind: Kind of the entity for which metadata is stored
        :type kind: str
        :param metadata: Entity metadata
        :type metadata: :py:class:`leapp.utils.audit.Metadata`
        :param name: Name of the entity
        :type name: str
        R9R>N(R.RPR/R:tnameROR(t
_entity_id(R"R9R>R:RORQ((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pyR/9s

			cCs|jS(sy
        Returns the id of the entry, which is only set when already stored.
        :return: Integer id or None
        (RR(R"((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pyt	entity_idLscCs�tt|�j|�|jj|�|jd|j|j|j|jjf�|jd|j|j|jf�}|j	�d|_
dS(NsTINSERT OR IGNORE INTO entity (context, kind, name, metadata_hash) VALUES(?, ?, ?, ?)sASELECT id FROM entity WHERE context = ? AND kind = ? AND name = ?i(R.RPR!RORR9R:RQRCRRR(R"R#R;((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pyR!Ts"N(R%R&R'R(R/R<RSR!(((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pyRP4stMessagec	BsAeZddddddddd�Zed��Zd�ZRS(c			Csutt|�jd|d|d|d|�|pGtjj�j�d|_||_||_||_	d|_dS(s�
        :param stamp: Timestamp string of the message creation in iso format
        :type stamp: str
        :param msg_type: Name of the model that represents the message payload
        :type msg_type: str
        :param topic: Topic for this message
        :type topic: str
        :param data: Payload data
        :type data: :py:class:`leapp.utils.audit.MessageData`
        :param actor: Name of the actor that triggered the entry
        :type actor: str
        :param phase: In which phase of the workflow execution the message was created
        :type phase: str
        :param context: The execution context
        :type context: str
        :param hostname: Hostname of the system that produced the message
        :type hostname: str
        RERFR>R9R,N(R.RTR/R0R1R2R3tmsg_typettopicRBR(t_message_id(	R"R3RURVRBRERFR>R9((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pyR/as+"			cCs|jS(sy
        Returns the id of the entry, which is only set when already stored.
        :return: Integer id or None
        (RW(R"((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pyt
message_id|scCsott|�j|�|jj|�|jd|j|j|j|j|j	|jj
f�}|j|_dS(NsmINSERT INTO message (context, stamp, topic, type, data_source_id, message_data_hash) VALUES(?, ?, ?, ?, ?, ?)(
R.RTR!RBRR9R3RVRURHRCt	lastrowidRW(R"R#R;((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pyR!�s0N(R%R&R(R/R<RXR!(((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pyRT`stDialogcBsAeZdZddddddd�Zed��Zd�ZRS(sE
    Stores information about dialog questions and their answers
    c	CsPtt|�jd|d|d|d|�|p4d|_||_d|_dS(s�
        :param scope: Dialog scope
        :type scope: str
        :param data: Payload data
        :type data: dict
        :param actor: Name of the actor that triggered the entry
        :type actor: str
        :param phase: In which phase of the workflow execution the dialog was triggered
        :type phase: str
        :param hostname: Hostname of the system that produced the message
        :type hostname: str
        :param context: The execution context
        :type context: str
        RERFR>R9tN(R.RZR/tscopeRBR(t
_dialog_id(R"R\RBRERFR>R9((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pyR/�s+	cCs|jS(sy
        Returns the id of the entry, which is only set when already stored.
        :return: Integer id or None
        (R](R"((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pyt	dialog_id�scCsYtt|�j|�|jd|j|jtj|j�|j	f�}|j
|_dS(NsVINSERT OR IGNORE INTO dialog (context, scope, data, data_source_id) VALUES(?, ?, ?, ?)(R.RZR!RR9R\R5R6RBRHRYR](R"R#R;((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pyR!�s
*N(R%R&R'R(R/R<R^R!(((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pyRZ�scCs�titjjdd�d6tjjdd�d6tjjdd�d	6tjjd
d�d6|d
6|d6|d6�j�dS(s�
    Create an audit entry

    :param event: Event type identifier
    :param data: Data related to Type of the event, e.g. a command and its arguments
    :param message: An optional message.
    :return:
    tLEAPP_CURRENT_ACTORsNO-ACTOR-SETREtLEAPP_CURRENT_PHASEsNON-WORKFLOW-EXECUTIONRFtLEAPP_EXECUTION_IDsTESTING-CONTEXTR9tLEAPP_HOSTNAMEsTESTING-LEAPP-HOSTNAMER>tmessageteventRBN(tAuditRRRR$(RdRBRc((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pytcreate_audit_entry�s	cCsDtd��2}|jd||f�}t|_|j�SWdQXdS(s
    Retrieve audit entries stored in the database for the given context

    :param event: Event type identifier
    :type event: str
    :param context: The execution context
    :type context: str
    :return: list of dicts with id, time stamp, actor and phase fields
    sZ
            SELECT
                audit.id          AS id,
                audit.stamp       AS stamp,
                audit.data        AS data,
                audit.context     AS context,
                data_source.actor AS actor,
                host.hostname     AS hostname
              FROM
                audit
              JOIN
                data_source ON data_source.id = audit.data_source_id
              JOIN
                host ON data_source.host_id = host.id
              WHERE
                audit.context = ? AND audit.event = ?
              ORDER BY stamp ASC;
        N(RR(Rtdict_factorytrow_factorytfetchall(RdR9tconnR;((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pytget_audit_entry�s

	Rec	BsAeZddddddddd�Zed��Zd�ZRS(c			Csutt|�jd|d|d|d|�||_|pPtjj�j�d|_||_||_	d|_dS(sx
        :param event: Type of this event e.g. new-message or log-message but can be anything
        :type event: str
        :param stamp: Timestamp string of the event creation in iso format
        :type stamp: str
        :param message: A message object, if this audit entry represents a message otherwise None
        :type message: :py:class:`leapp.utils.audit.Message` or None
        :param data: If message is None this has to be the data for the audit entry
        :type data: str or None
        :param actor: Name of the actor that triggered the entry
        :type actor: str
        :param phase: In which phase of the workflow execution the data entry was created
        :type phase: str
        :param context: The execution context
        :type context: str
        :param hostname: Hostname of the system that produced the entry
        :type hostname: str
        RERFR>R9R,N(R.ReR/RdR0R1R2R3RcRBR(t	_audit_id(	R"RdR3RcRBRERFR>R9((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pyR/�s+	"		cCs|jS(N(Rl(R"((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pytaudit_idsc
Cs�|jr
dStt|�j|�|jrL|jjrL|jj|�n|jr�t|jt�r�t	j
|j�|_n|jd|j|j
|j|j|jr�|jjnd|jf�}|j|_dS(NsdINSERT INTO audit (event, stamp, context, data_source_id, message_id, data) VALUES(?, ?, ?, ?, ?, ?)(RlR.ReR!RcRXRBR4RR5R6RRdR3R9RHR(RY(R"R#R;((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pyR!s	'N(R%R&R(R/R<RmR!(((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pyRe�scCs<i}x/t|j�D]\}}||||d<qW|S(Ni(t	enumeratetdescription(R;trowtdtidxtcol((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pyRg!ss�
        SELECT
             id, context, stamp, topic, type, actor, phase, message_hash, message_data, hostname
        FROM
             messages_data
        WHERE context = ? AND type IN (%s)c
Cs�|s
d
Std|���}|jtdjdt|��|ft|��}t|_|j�}x8|D]0}i|j	d�d6|j	d�d6|d<qnW|SWd	QXd	S(s�
    Queries all messages from the database for the given context and the list of model names
    :param names: List of names that should be messages returned for
    :type names: list or tuple of str
    :param context: Execution id the message should be queried from.
    :param connection: Database connection to use instead of the default one.
    :return: Iterable with messages
    :rtype: iterable
    Rs, t?tmessage_dataRBtmessage_hashthashRcN((
RRt_MESSAGE_QUERY_TEMPLATEtjointlenttupleRgRhRitpop(tnamesR9R#RjR;tresultRp((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pytget_messages0s
6	
.t
checkpointcCs5tdtd|d|d|d|�}|j�dS(s�
    Creates a checkpoint audit entry

    :param actor: Name of the actor that triggered the entry
    :type actor: str
    :param phase: In which phase of the workflow execution the data entry was created
    :type phase: str
    :param context: The execution context
    :type context: str
    :param hostname: Hostname of the system that produced the entry
    :type hostname: str
    :return: None
    RdRERFR>R9N(Ret_AUDIT_CHECKPOINT_EVENTR$(RERFR9R>taudit((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pyR�Ks'cCstdd|�S(s�
    Queries all error messages from the database for the given context

    :param context: The execution context
    :type context: str
    :return: List of error messages
    t
ErrorModelR9(R�(R(R9((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pyt
get_errors^scCsDtd��2}|jd|tf�}t|_|j�SWdQXdS(s�
    Retrieve all checkpoints stored in the database for the given context

    :param context: The execution context
    :type context: str
    :return: list of dicts with id, timestamp, actor and phase fields
    s�
            SELECT
                audit.id          AS id,
                audit.stamp       AS stamp,
                data_source.actor AS actor,
                data_source.phase AS phase
              FROM
                audit
              JOIN
                data_source ON data_source.id = audit.data_source_id
              WHERE
                audit.context = ? AND audit.event = ?
              ORDER BY audit.id ASC;
        N(RR(RR�RgRhRi(R9RjR;((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pytget_checkpointsis

	cs�d}d}|j��ig�dD]"�t�fd	�|D��^q&d6|d
6}|j�fd�|D��td|jd
|dtjddtjddtjddtjd�}|j�|S(s�
    Store ``dialog`` with accompanying ``answer``.

    :param dialog: instance of a workflow to store.
    :type dialog: :py:class:`leapp.dialogs.Dialog`
    :param answer: Answer to for each component of the dialog
    :type answer: dict
    tkeytlabelRotdefaulttvaluetreasonttitlet
componentsc3s|]}|�|fVqdS(N((t.0R�(t	component(s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pys	<genexpr>�stanswerc3s|]}|�|fVqdS(N((R�R�(ttmp(s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pys	<genexpr>�sR\RBR9RaRER_RFR`R>Rb(skeyR�sdescriptionsdefaultsvaluesreason(stitlesreason(t	serializetdicttupdateRZR\RRR$(tdialogR�tcomponent_keystdialog_keysRBte((R�R�s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pytstore_dialog�s 
4
	



cCs�tjt|�j�dt�}tj|jd��j�}t	d|d|�}t
ddd|jdtj
d	d
tj
dd|�}|j�dS(
s�
    Store the metadata of the given ``workflow`` into the database.

    :param workflow: Workflow to store.
    :type workflow: :py:class:`leapp.workflows.Workflow`
    R-sutf-8RORCR:tworkflowRQR9RaR>RbN(R5R6ttypeR�R7thashlibtsha256tencodet	hexdigestRNRPRQRRR$(R�ROtmetadata_hash_idtmdtent((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pytstore_workflow_metadata�s!	

	csbt|j����jitd��jdd�D��d6td��jdd�D��d6td��jdd�D��d6g�jdd�D]}|j�^q�d6�|�d<d}tj�fd
�|D�dt�}t	j
|jd��j�}t
d|d|�}tddd
|jdtjddtjdd|�}|j�dS(s�
    Store the metadata of the given actor given as an ``actor_definition``
    object into the database.

    :param actor_definition: Actor to store
    :type actor_definition: :py:class:`leapp.repository.actor_definition.ActorDefinition`
    css|]}|jVqdS(N(R%(R�tmodel((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pys	<genexpr>�stconsumescss|]}|jVqdS(N(R%(R�R�((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pys	<genexpr>�stproducescss|]}|jVqdS(N(R%(R�ttag((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pys	<genexpr>�sttagstconfig_schemasRFt
class_nameRQRoRcsi|]}�||�qS(((R�tfield(t	_metadata(s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pys
<dictcomp>�s	R-sutf-8RORCR:RER9RaR>RbN(((((	R�snamesdescriptionsphaseR�R�R�R�spath(R�tdiscoverR�tsortedRR�R5R6R7R�R�R�R�RNRPRQRRR$(tactor_definitionRFR�tactor_metadata_fieldsROR�R�R�((R�s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pytstore_actor_metadata�s$		###0
%	

	(,t
contextlibRR0R5RRR�tleapp.configRtleapp.compatRtleapp.utils.schemasRRR	RRRtobjectR R)R=RARDRIRKRNRPRTRZR(RfRkReRgRxRR�R�R�R�R�R�R�(((s>/usr/lib/python2.7/site-packages/leapp/utils/audit/__init__.pyt<module>sH	!		
*#%,.)	!5					%