#NEWLINE# def repo_install( distro , reponame , baseurl , gpgkey , **kw ) : #NEWLINE# #INDENT# packages = map_components ( NON_SPLIT_PACKAGES , kw . pop ( 'components' , [ ] ) ) #NEWLINE# logger = distro . conn . logger #NEWLINE# name = kw . pop ( 'name' , ( '%s repo' % kw ) ) #NEWLINE# enabled = kw . pop ( 'enabled' , 1 ) #NEWLINE# gpgcheck = kw . pop ( 'gpgcheck' , 1 ) #NEWLINE# install_ceph = kw . pop ( 'install_ceph' , False ) #NEWLINE# proxy = kw . pop ( 'proxy' , '' ) #NEWLINE# _type = 'repo-md' #NEWLINE# baseurl = baseurl . strip ( '/' ) #NEWLINE# distro . packager . clean ( ) #NEWLINE# if gpgkey : #NEWLINE# #INDENT# distro . packager . add_repo_gpg_key ( gpgkey ) #NEWLINE# #UNINDENT# repo_content = templates . custom_repo ( reponame = reponame , name = name , baseurl = baseurl , enabled = enabled , gpgcheck = gpgcheck , _type = _type , gpgkey = gpgkey , proxy = proxy , ** kw ) #NEWLINE# distro . conn . remote_module . write_yum_repo ( repo_content , ( '%s.repo' % reponame ) ) #NEWLINE# repo_path = '/etc/yum.repos.d/{reponame}.repo' . format ( reponame = reponame ) #NEWLINE# if kw . get ( 'priority' ) : #NEWLINE# #INDENT# if ( distro . packager . name == 'yum' ) : #NEWLINE# #INDENT# distro . packager . install ( 'yum-plugin-priorities' ) #NEWLINE# #UNINDENT# distro . conn . remote_module . set_repo_priority ( [ reponame ] , repo_path ) #NEWLINE# logger . warning ( 'altered {reponame}.repo priorities to contain: priority=1' . format ( reponame = reponame ) ) #NEWLINE# #UNINDENT# if ( install_ceph and packages ) : #NEWLINE# #INDENT# distro . packager . install ( packages )