Esempio n. 1
0
 def new ( name ) :
     _config = repolib.config.read_mirror_config( name )
     if _config['type'] == "yum" :
         return repolib.yum_repository( _config )
     elif _config['type'] == "fedora" :
         return repolib.fedora_repository( _config )
     elif _config['type'] == "centos" :
         return repolib.centos_repository( _config )
     elif _config['type'] == "fedora_upd" :
         return repolib.fedora_update_repository( _config )
     elif _config['type'] == "centos_upd" :
         return repolib.centos_update_repository( _config )
     elif _config['type'] == "deb" :
         return repolib.debian_repository( _config )
     elif _config['type'] == "feed" :
         return repolib.feed_repository( _config )
     else :
         raise Exception( "Unknown repository type '%s'" % _config['type'] )
Esempio n. 2
0
 def new ( name ) :
     _config = repolib.config.read_mirror_config( name )
     if _config['type'] == "yum" :
         return repolib.yum_repository( _config )
     elif _config['type'] == "fedora" :
         return repolib.fedora_repository( _config )
     elif _config['type'] == "centos" :
         return repolib.centos_repository( _config )
     elif _config['type'] == "fedora_upd" :
         return repolib.fedora_update_repository( _config )
     elif _config['type'] == "centos_upd" :
         return repolib.centos_update_repository( _config )
     elif _config['type'] == "deb" :
         repolib.logger.error( "Repo %s : 'deb' type on %s is obsolete, use 'apt' instead" % ( name , _config.__file__ ) )
         _config['type'] = "apt"
         return repolib.debian_repository( _config )
     elif _config['type'] == "apt" :
         return repolib.debian_repository( _config )
     elif _config['type'] == "feed" :
         return repolib.feed_repository( _config )
     else :
         raise Exception( "Unknown repository type '%s'" % _config['type'] )
Esempio n. 3
0
 def new(name):
     _config = repolib.config.read_mirror_config(name)
     if _config['type'] == "yum":
         return repolib.yum_repository(_config)
     elif _config['type'] == "fedora":
         return repolib.fedora_repository(_config)
     elif _config['type'] == "centos":
         return repolib.centos_repository(_config)
     elif _config['type'] == "fedora_upd":
         return repolib.fedora_update_repository(_config)
     elif _config['type'] == "centos_upd":
         return repolib.centos_update_repository(_config)
     elif _config['type'] == "deb":
         repolib.logger.error(
             "Repo %s : 'deb' type on %s is obsolete, use 'apt' instead" %
             (name, _config.__file__))
         _config['type'] = "apt"
         return repolib.debian_repository(_config)
     elif _config['type'] == "apt":
         return repolib.debian_repository(_config)
     elif _config['type'] == "feed":
         return repolib.feed_repository(_config)
     else:
         raise Exception("Unknown repository type '%s'" % _config['type'])