(self, imagerepo)
return (imagerepo, remoterepo)
Parse imagerepo to extract registry
Parse imagerepo to extract registry
Parse imagerepo to extract registry
def _parse_imagerepo(self, imagerepo):
        """Parse imagerepo to extract registry"""
        remoterepo = imagerepo
        registry = ""
        registry_url = ""
        index_url = ""
        components = imagerepo.split('/')
        if '.' in components[0] and len(components) >= 2:
            registry = components[0]
            del components[0]
        elif ('.' not in components[0] and
              components[0] != "library" and len(components) == 1):
            components.insert(0, "library")
        remoterepo = '/'.join(components)
        if registry:
            try:
                registry_url = Config.conf['docker_registries'][registry][0]
                index_url = Config.conf['docker_registries'][registry][1]
            except (KeyError, NameError, TypeError):
                registry_url = registry
                if "://" not in registry:
                    registry_url = "https://%s" % registry
                index_url = registry_url
            if registry_url:
                self.registry_url = registry_url
            if index_url:
                self.index_url = index_url
        return (imagerepo, remoterepo)
def _parse_imagerepo ( self , imagerepo ) : remoterepo = imagerepo registry = "" registry_url = "" index_url = "" components = imagerepo . split ( '/' ) if '.' in components [ 0 ] and len ( components ) >= 2 : registry = components [ 0 ] del components [ 0 ] elif ( '.' not in components [ 0 ] and components [ 0 ] != "library" and len ( components ) == 1 ) : components . insert ( 0 , "library" ) remoterepo = '/' . join ( components ) if registry : try : registry_url = Config . conf [ 'docker_registries' ] [ registry ] [ 0 ] index_url = Config . conf [ 'docker_registries' ] [ registry ] [ 1 ] except ( KeyError , NameError , TypeError ) : registry_url = registry if "://" not in registry : registry_url = "https://%s" % registry index_url = registry_url if registry_url : self . registry_url = registry_url if index_url : self . index_url = index_url return ( imagerepo , remoterepo )