예제 #1
0
def update_tags(repo_id, tarfile_path):
    """
    Gets the current scratchpad's tags and updates them with the tags contained
    in the tarfile.

    :param repo_id:         unique ID of a repository
    :type  repo_id:         basestring
    :param tarfile_path:    full path to a tarfile that is the product
                            of "docker save"
    :type  tarfile_path:    basestring
    """
    new_tags = tarutils.get_tags(tarfile_path)
    tags.update_tags(repo_id, new_tags)
예제 #2
0
def update_tags(repo_id, tarfile_path):
    """
    Gets the current scratchpad's tags and updates them with the tags contained
    in the tarfile.

    :param repo_id:         unique ID of a repository
    :type  repo_id:         basestring
    :param tarfile_path:    full path to a tarfile that is the product
                            of "docker save"
    :type  tarfile_path:    basestring
    """
    new_tags = tarutils.get_tags(tarfile_path)
    tags.update_tags(repo_id, new_tags)
예제 #3
0
    def process_main(self, item=None):
        """
        Pull the metadata out of the tar file
        :param item: Not used by this Step
        :type  item: None
        """

        # retrieve metadata from the tarball
        metadata = tarutils.get_metadata(self.parent.file_path)
        # turn that metadata into a collection of models
        mask_id = self.get_config().get(constants.CONFIG_KEY_MASK_ID)
        self.parent.metadata = metadata
        self.parent.available_units = self.get_models(metadata, mask_id)
        self.parent.v1_tags = tarutils.get_tags(self.parent.file_path)
예제 #4
0
    def process_main(self, item=None):
        """
        Pull the metadata out of the tar file
        :param item: Not used by this Step
        :type  item: None
        """

        # retrieve metadata from the tarball
        metadata = tarutils.get_metadata(self.parent.file_path)
        # turn that metadata into a collection of models
        mask_id = self.get_config().get(constants.CONFIG_KEY_MASK_ID)
        self.parent.metadata = metadata
        self.parent.available_units = self.get_models(metadata, mask_id)
        self.parent.v1_tags = tarutils.get_tags(self.parent.file_path)
예제 #5
0
파일: upload.py 프로젝트: beav/pulp_docker
def update_tags(repo_id, tarfile_path):
    """
    Gets the current scratchpad's tags and updates them with the tags contained
    in the tarfile.

    :param repo_id:         unique ID of a repository
    :type  repo_id:         basestring
    :param tarfile_path:    full path to a tarfile that is the product
                            of "docker save"
    :type  tarfile_path:    basestring
    """
    repo_manager = factory.repo_manager()
    new_tags = tarutils.get_tags(tarfile_path)
    scratchpad = repo_manager.get_repo_scratchpad(repo_id)

    tags = generate_updated_tags(scratchpad, new_tags)
    repo_manager.update_repo_scratchpad(repo_id, {'tags': tags})
예제 #6
0
    def test_normal(self):
        tags = tarutils.get_tags(busybox_tar_path)

        self.assertEqual(tags, {'latest': busybox_ids[0]})
예제 #7
0
    def test_normal(self):
        tags = tarutils.get_tags(busybox_tar_path)

        self.assertEqual(tags, {'latest': busybox_ids[0]})