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/scan.pyc
�
9�Egc@sddlZddlmZmZddlmZddlmZddlm	Z	ddl
mZmZm
Z
d�Zd�Zded	�Zd
�Zd�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�ZdS(i����N(t
RepositorytDefinitionKind(tRepositoryManager(tActorDefinition(tRepositoryConfigurationError(tget_global_repositories_datatget_user_config_repo_datat
find_reposcCsxi}xFt�j�D]5\}}|dr|ji|d|d6�qqW|rt|jt�jdi��n|S(Ntenabledtpathtidtrepos(RtitemstupdateRtget(tinclude_localstdatatrepo_idtentry((s9/usr/lib/python2.7/site-packages/leapp/repository/scan.pyt_make_repo_lookup
s
#cCs�td|�}|r1|j�r1td��nt}xT|s�|j�}x;|D]-}||krS|jt||��PqSqSWt}q:W|j�r�tdjdj|����ndS(NRs=No repos configured? Try adding some with "snactor repo find"s!Missing repositories detected: {}s, (	Rtget_missing_repo_linksRtFalsetadd_repot	scan_repotTruetformattjoin(tmanagerRtrepo_lookuptfinishedtmissingR((s9/usr/lib/python2.7/site-packages/leapp/repository/scan.pyt_resolve_repository_linkss	

cCsetjj|�ra|pt�}x't|�D]}|jt|��q.Wtd|d|�n|S(s.
    Finds and scans all repositories found in the path and it will also resolve linked repositories.
    Using include_locals=True will additionally include user local repositories to be considered for
    resolving linked repositories.

    :param path: Path to scan for repositories
    :param manager: Optional repository manager to add found repos too
    :param include_locals: Should repositories linked be searched from the user local registry
    :return: repository manager instance (either passed through or a new instance if none was passed)
    RR(tosR	texistsRRRRR(R	RRt
repository((s9/usr/lib/python2.7/site-packages/leapp/repository/scan.pytfind_and_scan_repositories*scCs%tjj|�}tt|�|�S(sn
    Scans all related repository resources

    :param path:
    :type path: str
    :return: repository
    (R R	tabspathtscanR(R	((s9/usr/lib/python2.7/site-packages/leapp/repository/scan.pyR=scCs|jjd|�dtfdtfdtfdtfdtfdtfdtfd	t	fd
t
fdtfdtff}gt
j|�D]-}t
jjt
jj||��r�|^q�}xB|D]:\}}||kr�||t
jj||�|�q�q�W|S(
s�
    Scans all repository resources

    :param repository:
    :type repository: :py:class:`leapp.repository.Repository`
    :param path: path to the repository
    :type path: str
    :return: instance of :py:class:`leapp.repository.Repository`
    sScanning path %sttopicstmodelstactorsttagst	workflowstfilest	librariestconfigstteststtoolstapis(tlogtdebugtscan_topicstscan_modelstscan_actorst	scan_tagstscan_workflowst
scan_filestscan_librariestscan_configst
scan_testst
scan_toolst	scan_apisR tlistdirR	tisdirR(R"R	t
scan_taskstetdirstnamettask((s9/usr/lib/python2.7/site-packages/leapp/repository/scan.pyR%Is"
										C&cCs�x�tj|�D]~\}}}xl|D]d}tjj|�\}}|dkr&tjj||�}|jtjtjj||��q&q&WqWdS(s
    Scans topics and adds them to the repository.

    :param repo: Instance of the repository
    :type repo: :py:class:`leapp.repository.Repository`
    :param path: path to the topics
    :type path: str
    :param repo_path: path to the repository
    :type repo_path: str
    s.pyN(	R twalkR	tsplitextRtaddRtTOPICtrelpath(trepoR	t	repo_pathtroottunusedR+tmoduletext((s9/usr/lib/python2.7/site-packages/leapp/repository/scan.pyR3hs
c
Cs�x�tj|�D]r\}}}x`|D]X}|dkr&tjj||�}|jtjtt||d|j	�|��q&q&WqWdS(s
    Scans actors and adds them to the repository.

    :param repo: Instance of the repository
    :type repo: :py:class:`leapp.repository.Repository`
    :param path: path to the actors
    :type path: str
    :param repo_path: path to the repository
    :type repo_path: str
    sactor.pyR1N(
R RER	RIRGRtACTORR%RR1(RJR	RKRLRMR+RNtrel_path((s9/usr/lib/python2.7/site-packages/leapp/repository/scan.pyR5{s

cCs�x�tj|�D]~\}}}xl|D]d}tjj|�\}}|dkr&tjj||�}|jtjtjj||��q&q&WqWdS(s
    Scans tags and adds them to the repository.

    :param repo: Instance of the repository
    :type repo: :py:class:`leapp.repository.Repository`
    :param path: path to the tags
    :type path: str
    :param repo_path: path to the repository
    :type repo_path: str
    s.pyN(	R RER	RFRRGRtTAGRI(RJR	RKRLRMR+RNRO((s9/usr/lib/python2.7/site-packages/leapp/repository/scan.pyR6�s
cCs�x�tj|�D]~\}}}xl|D]d}tjj|�\}}|dkr&tjj||�}|jtjtjj||��q&q&WqWdS(s
    Scans models and adds them to the repository.

    :param repo: Instance of the repository
    :type repo: :py:class:`leapp.repository.Repository`
    :param path: path to the models
    :type path: str
    :param repo_path: path to the repository
    :type repo_path: str
    s.pyN(	R RER	RFRRGRtMODELRI(RJR	RKRLRMR+RNRO((s9/usr/lib/python2.7/site-packages/leapp/repository/scan.pyR4�s
cCs�x�tj|�D]~\}}}xl|D]d}tjj|�\}}|dkr&tjj||�}|jtjtjj||��q&q&WqWdS(s 
    Scans workflows and adds them to the repository.

    :param repo: Instance of the repository
    :type repo: :py:class:`leapp.repository.Repository`
    :param path: path to the workflows
    :type path: str
    :param repo_path: path to the repository
    :type repo_path: str
    s.pyN(	R RER	RFRRGRtWORKFLOWRI(RJR	RKRLRMR+RNRO((s9/usr/lib/python2.7/site-packages/leapp/repository/scan.pyR7�s
cCs8tj|�r4|jtjtjj||��ndS(s
    Scans files and adds them to the repository.

    :param repo: Instance of the repository
    :type repo: :py:class:`leapp.repository.Repository`
    :param path: path to the files
    :type path: str
    :param repo_path: path to the repository
    :type repo_path: str
    N(R R>RGRtFILESR	RI(RJR	RK((s9/usr/lib/python2.7/site-packages/leapp/repository/scan.pyR8�scCs8tj|�r4|jtjtjj||��ndS(s 
    Scans libraries and adds them to the repository.

    :param repo: Instance of the repository
    :type repo: :py:class:`leapp.repository.Repository`
    :param path: path to the libraries
    :type path: str
    :param repo_path: path to the repository
    :type repo_path: str
    N(R R>RGRt	LIBRARIESR	RI(RJR	RK((s9/usr/lib/python2.7/site-packages/leapp/repository/scan.pyR9�scCs8tj|�r4|jtjtjj||��ndS(s
    Scans configs and adds them to the repository.

    :param repo: Instance of the repository
    :type repo: :py:class:`leapp.repository.Repository`
    :param path: path to the configs
    :type path: str
    :param repo_path: path to the repository
    :type repo_path: str
    N(R R>RGRtCONFIGSR	RI(RJR	RK((s9/usr/lib/python2.7/site-packages/leapp/repository/scan.pyR:�scCs8tj|�r4|jtjtjj||��ndS(s
    Scans tools and adds them to the repository.

    :param repo: Instance of the repository
    :type repo: :py:class:`leapp.repository.Repository`
    :param path: path to the tools
    :type path: str
    :param repo_path: path to the repository
    :type repo_path: str
    N(R R>RGRtTOOLSR	RI(RJR	RK((s9/usr/lib/python2.7/site-packages/leapp/repository/scan.pyR<�scCs8tj|�r4|jtjtjj||��ndS(s
    Scans tests and adds them to the repository.

    :param repo: Instance of the repository
    :type repo: :py:class:`leapp.repository.Repository`
    :param path: path to the tests
    :type path: str
    :param repo_path: path to the repository
    :type repo_path: str
    N(R R>RGRtTESTSR	RI(RJR	RK((s9/usr/lib/python2.7/site-packages/leapp/repository/scan.pyR;scCs8tj|�r4|jtjtjj||��ndS(s
    Scans apis and adds them to the repository.

    :param repo: Instance of the repository
    :type repo: :py:class:`leapp.repository.Repository`
    :param path: path to the apis
    :type path: str
    :param repo_path: path to the repository
    :type repo_path: str
    N(R R>RGRtAPIR	RI(RJR	RK((s9/usr/lib/python2.7/site-packages/leapp/repository/scan.pyR=s( R tleapp.repositoryRRtleapp.repository.managerRt!leapp.repository.actor_definitionRtleapp.exceptionsRtleapp.utils.repositoryRRRRRtNoneRR#RR%R3R5R6R4R7R8R9R:R<R;R=(((s9/usr/lib/python2.7/site-packages/leapp/repository/scan.pyt<module>s*