From 3c0dc9dfd089c1043e45ece9472dccf7cbace3de Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Aug 07 2017 17:50:42 +0000 Subject: No more pkgdb. This removes the use of pkgdb from the retirement process. That will instead be handled by this server side component: https://github.com/fedora-infra/pdc-updater/blob/develop/pdcupdater/handlers/retirement.py Signed-off-by: Ralph Bean --- diff --git a/conf/etc/rpkg/fedpkg-stage.conf b/conf/etc/rpkg/fedpkg-stage.conf index 9272ad2..a0fb7b4 100644 --- a/conf/etc/rpkg/fedpkg-stage.conf +++ b/conf/etc/rpkg/fedpkg-stage.conf @@ -20,6 +20,3 @@ kerberos_realms = STG.FEDORAPROJECT.ORG # Refer to fedpkg.conf url = https://bodhi.stg.fedoraproject.org/ staging = True - -[fedpkg-stage.pkgdb] -url = https://admin.stg.fedoraproject.org/pkgdb/ diff --git a/conf/etc/rpkg/fedpkg.conf b/conf/etc/rpkg/fedpkg.conf index 5df9981..f03c444 100644 --- a/conf/etc/rpkg/fedpkg.conf +++ b/conf/etc/rpkg/fedpkg.conf @@ -25,6 +25,3 @@ url = https://bodhi.fedoraproject.org/ # different instance. Instead, --staging is available to switch to the stage # bodhi, and production is used without providing --staging. staging = False - -[fedpkg.pkgdb] -url = https://admin.fedoraproject.org/pkgdb/ diff --git a/fedpkg/cli.py b/fedpkg/cli.py index d90cdc4..77357cd 100644 --- a/fedpkg/cli.py +++ b/fedpkg/cli.py @@ -16,8 +16,6 @@ import re import six import textwrap -import pkgdb2client - from six.moves.configparser import NoSectionError from six.moves.configparser import NoOptionError from pyrpkg import rpkgError @@ -51,8 +49,7 @@ class fedpkgClient(cliClient): 'retire', help='Retire a package', description='This command will remove all files from the repo, ' - 'leave a dead.package file, push the changes and ' - 'retire the package in pkgdb.' + 'leave a dead.package file, and push the changes.' ) retire_parser.add_argument('reason', help='Reason for retiring the package') @@ -72,8 +69,7 @@ class fedpkgClient(cliClient): module_name = self.cmd.module_name ns_module_name = self.cmd.ns_module_name namespace = ns_module_name.split(module_name)[0].rstrip('/') - # Skip if package is already retired to allow to retire only in - # pkgdb + # Skip if package is already retired... if os.path.isfile(os.path.join(self.cmd.path, 'dead.package')): self.log.warn('dead.package found, package probably already ' 'retired - will not remove files from git or ' @@ -82,12 +78,6 @@ class fedpkgClient(cliClient): self.cmd.retire(self.args.reason) self.push() - pkgdb_config = dict(self.config.items('%s.pkgdb' % self.name)) - branch = self.cmd.branch_merge - pkgdb = pkgdb2client.PkgDB(url=pkgdb_config['url'], - login_callback=pkgdb2client.ask_password) - pkgdb.retire_packages(module_name, branch, namespace=namespace) - def _format_update_clog(self, clog): ''' Format clog for the update template. ''' lines = [l for l in clog.split('\n') if l] diff --git a/test/fedpkg-test.conf b/test/fedpkg-test.conf index 6ef6ec2..b3a4bf8 100644 --- a/test/fedpkg-test.conf +++ b/test/fedpkg-test.conf @@ -11,6 +11,3 @@ build_client = koji [fedpkg.bodhi] url = https://bodhi.dummy.example.com/ - -[fedpkg.pkgdb] -url = https://admin.dummy.example.com/pkgdb/ diff --git a/test/test_retire.py b/test/test_retire.py index 9da76cb..3006846 100644 --- a/test/test_retire.py +++ b/test/test_retire.py @@ -71,8 +71,7 @@ class RetireTestCase(unittest.TestCase): 'fedpkg.spec'))) self.assertEqual(self._get_latest_commit(), reason) - @mock.patch('pkgdb2client.PkgDB') - def test_retire_with_namespace(self, PkgDB): + def test_retire_with_namespace(self): self._setup_repo('ssh://git@pkgs.example.com/rpms/fedpkg') args = ['fedpkg', '--dist=master', 'retire', 'my reason'] @@ -81,12 +80,9 @@ class RetireTestCase(unittest.TestCase): self.assertRetired('my reason') self.assertEqual(len(client.cmd.push.call_args_list), 1) - self.assertEqual(PkgDB.return_value.retire_packages.call_args_list, - [mock.call('fedpkg', 'master', namespace='rpms')]) @mock.patch('fedora_cert.read_user_cert') - @mock.patch('pkgdb2client.PkgDB') - def test_retire_without_namespace(self, PkgDB, read_user_cert): + def test_retire_without_namespace(self, read_user_cert): self._setup_repo('ssh://git@pkgs.example.com/fedpkg') args = ['fedpkg', '--dist=master', 'retire', 'my reason'] @@ -97,5 +93,3 @@ class RetireTestCase(unittest.TestCase): self.assertRetired('my reason') self.assertEqual(len(client.cmd.push.call_args_list), 1) - self.assertEqual(PkgDB.return_value.retire_packages.call_args_list, - [mock.call('fedpkg', 'master', namespace='rpms')])