Exemple #1
0
    def distributor_removed(self, repo, config):
        """
        Called when a distributor of this type is removed from a repository.

        :param repo: metadata describing the repository
        :type  repo: pulp.plugins.model.Repository

        :param config: plugin configuration
        :type  config: pulp.plugins.config.PluginCallConfiguration
        """
        # remove the directories that might have been created for this repo/distributor
        dir_list = [configuration.get_master_publish_dir(repo, ids.TYPE_ID_DISTRIBUTOR_EXPORT),
                    os.path.join(configuration.HTTP_EXPORT_DIR, repo.id),
                    os.path.join(configuration.HTTPS_EXPORT_DIR, repo.id)]

        for repo_dir in dir_list:
            shutil.rmtree(repo_dir, ignore_errors=True)
Exemple #2
0
    def distributor_removed(self, repo, config):
        """
        Called when a distributor of this type is removed from a repository.

        :param repo: metadata describing the repository
        :type  repo: pulp.plugins.model.RepositoryGroup

        :param config: plugin configuration
        :type  config: pulp.plugins.config.PluginCallConfiguration
        """
        # remove the directories that might have been created for this repo/distributor
        dir_list = [configuration.get_master_publish_dir(repo,
                                                         ids.TYPE_ID_DISTRIBUTOR_GROUP_EXPORT),
                    os.path.join(configuration.HTTP_EXPORT_GROUP_DIR, repo.id),
                    os.path.join(configuration.HTTPS_EXPORT_GROUP_DIR, repo.id)]

        for repo_dir in dir_list:
            shutil.rmtree(repo_dir, ignore_errors=True)