コード例 #1
0
ファイル: distributor.py プロジェクト: hjensas/pulp_rpm
    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)
コード例 #2
0
ファイル: groupdistributor.py プロジェクト: aeria/pulp_rpm
    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)