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/repository/__init__.pyo
�
9�Egc@s@ddlmZddlZddlZddlZddlmZddlmZm	Z	ddl
mZmZddl
ZddlZddlmZddlmZddlmZdd	lmZdd
lmZddlmZmZmZddlZddlmZd
e fd��YZ!de fd��YZ"dS(i����(t	getLoggerN(tload_module(tRepoItemPathDoesNotExistErrortUnsupportedDefinitionKindError(t
get_modelstresolve_model_references(tActorDefinition(tDefinitionKind(tget_tags(t
get_topics(tLeappLibrariesFinder(tget_repository_idtget_repository_linkstget_repository_name(t
get_workflowst
_LoadStagecBs&eZdZdZdZdZdZRS(tinitialtmodelst	librariestactorst	workflows(t__name__t
__module__tINITIALtMODELSt	LIBRARIEStACTORSt	WORKFLOWS(((s=/usr/lib/python2.7/site-packages/leapp/repository/__init__.pyRs
t
RepositorycBs1eZdZd�Zed��Zed��Zed��Zd�Ze	d��Z
d�Zeded�Zd	�Zd
�Zd�Zd�Zed
��Zed��Zed��Zed��Zed��Zed��Zed��Zed��Zed��Zed��ZRS(s�
    The Repository class represents a place where all resources (actors, models, tags, etc.) are defined. See the
    :doc:`Repository Directory Layout <../repository-dir-layout>`.
    cCswt|�|_td�j|j�|_||_t|�|_t|�|_	i|_
|jjd|j|�dS(s^
        :param directory: Path to the repository folder
        :type directory: str
        sleapp.repositorys*A new repository '%s' is initialized at %sN(R
tnameRtgetChildtlogt	_repo_dirRt_repo_idRt_repo_linkst_definitionstinfo(tselft	directory((s=/usr/lib/python2.7/site-packages/leapp/repository/__init__.pyt__init__#s		cCs|jS(N(R (R%((s=/usr/lib/python2.7/site-packages/leapp/repository/__init__.pytrepo_dir0scCs|jS(N(R!(R%((s=/usr/lib/python2.7/site-packages/leapp/repository/__init__.pytrepo_id4scCs|jS(N(R"(R%((s=/usr/lib/python2.7/site-packages/leapp/repository/__init__.pyt
repo_links8scCsX|j�}xE|jD]:}|jj�}|jj�}|||fkr|SqWdS(s�
        Finds an actor in the repository

        :param name: Name of the actor
        :type name: str
        :return: None or Actor
        N(tlowerRRt
class_nametNone(R%Rtactort
actor_nametactor_class((s=/usr/lib/python2.7/site-packages/leapp/repository/__init__.pytlookup_actor<s	cCsj|j�}xWtjj�D]F}|jj�}|jj�}|j}||||fkr|SqWdS(s�
        Finds a workflow in the repository

        :param name: Name of the workflow class name, Workflow.name, or Workflow.short_name
        :type name: str
        :return: None or Workflow
        N(R+tleappRRRRt
short_nameR-(Rtworkflowt
workflow_nametworkflow_classtworkflow_short_name((s=/usr/lib/python2.7/site-packages/leapp/repository/__init__.pytlookup_workflowMs		cCs�|jjd|jt|t�r*|jn|�|tjkr^tdj	d|j���nt|t�s�t
jj|j
|�}t
jj|�s�|jjd|�t|||��n|}n|jj|g�j|�dS(sX
        Adds any supported kind of a resource to the repository

        :param kind: specific kind of the repository resource
        :type kind: :py:class:`leapp.repository.definition.DefinitionKind`
        :param item: Item that will be added
        :type item: :py:class:`leapp.repository.actor_definition.ActorDefiniton` or str
        sAdding %s - %ss#Repositories do not support {kind}.tkinds:Attempted to add %s, which is not in the repositories pathN(RtdebugRt
isinstanceRR&RtREPO_WHITELISTRtformattostpathtjoinR texiststerrorRR#t
setdefaulttappend(R%R9titemt	full_path((s=/usr/lib/python2.7/site-packages/leapp/repository/__init__.pytadd_s	1	c	CsI|s|tjkru|jjd|j�|jjd�|j|jd�|jjd�|j|jd�n|s�|tjkr�|jjd�|j|j	d�|r�t
�q�n|s�|tjkr�|jjd�|jd	|j
�|jjd
�|jd|j
�|jjd�|jd
|j�|jjd�tjjtddd|j��tjjtddd|j��tjjtddd|j��n|s	|s�|tjkr	|jjd�x|jD]}|j�q�Wq	n|s|tjkrE|jjd�|j|jd�ndS(s
        Loads the repository resources

        :param resolve: Decides whether or not to perform the resolving of model references
        :type resolve: bool
        :param stage: Stage to load - Required for repository managers
        :type stage: _LoadStage value
        sLoading repository %ssLoading tag moduless
leapp.tagssLoading topic modulessleapp.topicssLoading model modulessleapp.modelss$Extending PATH for common tool pathstPATHs2Extending LEAPP_COMMON_TOOLS for common tool pathstLEAPP_COMMON_TOOLSs2Extending LEAPP_COMMON_FILES for common file pathstLEAPP_COMMON_FILESs;Installing repository provided common libraries loader hookt
module_prefixsleapp.libraries.commontpathssleapp.workflows.apisleapp.configs.commonsRunning actor discoverysLoading workflow modulessleapp.workflowsN(RRRR:Rt
_load_modulesttagsttopicsRRRRt_extend_environ_pathsttoolstfilestsyst	meta_pathRDR
RtapistconfigsRRtdiscoverRR(R%tresolvetstagetskip_actors_discoveryR.((s=/usr/lib/python2.7/site-packages/leapp/repository/__init__.pytloadvs<	
""%cCs�g|D]*}tjj|jtjj|��^q}|jd�sP|dn|}x3tj|d|�D]\}}}t||�qlWdS(s�
        :param modules: Paths to modules of the same type to be imported
        :type list of str
        :param prefix: A prefix to be appended to module name in sys.modules
        :type str
        t.tprefixN(	R>R?R@R tdirnametendswithtpkgutiltiter_modulesR(R%tmodulesR]tmoduletdirectoriestimporterRtispkg((s=/usr/lib/python2.7/site-packages/leapp/repository/__init__.pyRM�s7%cCs�d�}d�}i|jd6g|jD]}||j��^q)d6g|j|j�D]}td|fg�^q[d6|t|j�d6|t|j	�d6|t
|j�d	6|t|j
�d
6g|j|j�D]}td|fg�^q�d6g|j|j�D]}td|fg�^qd6g|j|j�D]}td|fg�^qFd
6g|j|j�D]}td|fg�^q{d6S(sA
        :return: Dictionary of all repository resources
        cSskg}|�}xU|D]M}tjjtj|jjjdd��|kr|j|j	��qqW|S(Ns.pycs.py(
R>R?tabspathRSRbRt__file__treplaceRDt	serialize(tfuncRbtresulttdatatentry((s=/usr/lib/python2.7/site-packages/leapp/repository/__init__.pytfiltered_serialization�s	
1cSs�|jig|jdd�D]}|j^qd6g|jdd�D]}|j^qEd6g|jdd�D]}|j^qnd6�|S(NtconsumestproducesRN((((tupdatetgetR(Rmtmodelttag((s=/usr/lib/python2.7/site-packages/leapp/repository/__init__.pytmapped_actor_data�s
	))-R(RR?RURORRNRRQRRRRV(R RRjtrelative_pathsRUtdictR	RORRRRNRRRQRRRRV(R%RoRvtaR?((s=/usr/lib/python2.7/site-packages/leapp/repository/__init__.pyRj�s		
)5555csLdjtjj|d�jd�t�fd�|D���tj|<dS(Nt:tc3s'|]}tjj�j|�VqdS(N(R>R?R@R (t.0R?(R%(s=/usr/lib/python2.7/site-packages/leapp/repository/__init__.pys	<genexpr>�s(R@R>tenvironRstsplittlist(R%RRL((R%s=/usr/lib/python2.7/site-packages/leapp/repository/__init__.pyRP�s$cst�fd�|D��S(s=
        :return: Tuple of repository relative paths
        c3s'|]}tjj|�j�VqdS(N(R>R?trelpathR (R|tx(R%(s=/usr/lib/python2.7/site-packages/leapp/repository/__init__.pys	<genexpr>�s(ttuple(R%RL((R%s=/usr/lib/python2.7/site-packages/leapp/repository/__init__.pyRw�scCst|jjtjd��S(s<
        :return: Tuple of actors in the repository
        ((R�R#RsRtACTOR(R%((s=/usr/lib/python2.7/site-packages/leapp/repository/__init__.pyR�scCst|jjtjd��S(s:
        :return: Tuple of apis in the repository
        ((R�R#RsRtAPI(R%((s=/usr/lib/python2.7/site-packages/leapp/repository/__init__.pyRU�scCst|jjtjd��S(s<
        :return: Tuple of topics in the repository
        ((R�R#RsRtTOPIC(R%((s=/usr/lib/python2.7/site-packages/leapp/repository/__init__.pyRO�scCst|jjtjd��S(s<
        :return: Tuple of models in the repository
        ((R�R#RsRtMODEL(R%((s=/usr/lib/python2.7/site-packages/leapp/repository/__init__.pyR�scCst|jjtjd��S(s:
        :return: Tuple of tags in the repository
        ((R�R#RsRtTAG(R%((s=/usr/lib/python2.7/site-packages/leapp/repository/__init__.pyRNscCst|jjtjd��S(s?
        :return: Tuple of workflows in the repository
        ((R�R#RsRtWORKFLOW(R%((s=/usr/lib/python2.7/site-packages/leapp/repository/__init__.pyRscCst|jjtjd��S(s;
        :return: Tuple of tools in the repository
        ((R�R#RsRtTOOLS(R%((s=/usr/lib/python2.7/site-packages/leapp/repository/__init__.pyRQscCst|jjtjd��S(s?
        :return: Tuple of libraries in the repository
        ((R�R#RsRR(R%((s=/usr/lib/python2.7/site-packages/leapp/repository/__init__.pyRscCst|jjtjd��S(s=
        :return: Tuple of configs in the repository
        ((R�R#RsRtCONFIGS(R%((s=/usr/lib/python2.7/site-packages/leapp/repository/__init__.pyRVscCst|jjtjd��S(s;
        :return: Tuple of files in the repository
        ((R�R#RsRtFILES(R%((s=/usr/lib/python2.7/site-packages/leapp/repository/__init__.pyRR#sN(RRt__doc__R'tpropertyR(R)R*R1tstaticmethodR8RGtTrueR-tFalseR[RMRjRPRwRRURORRNRRQRRVRR(((s=/usr/lib/python2.7/site-packages/leapp/repository/__init__.pyRs.	
		-		+		(#tloggingRR>R`RStleapp.compatRtleapp.exceptionsRRtleapp.modelsRRtleapp.libraries.commonR2tleapp.configs.commont!leapp.repository.actor_definitionRtleapp.repository.definitionRt
leapp.tagsRtleapp.topicsR	tleapp.utils.libraryfinderR
tleapp.utils.repositoryRRR
tleapp.workflowsRtobjectRR(((s=/usr/lib/python2.7/site-packages/leapp/repository/__init__.pyt<module>s$