From a98c9798cd4a8e75963fcb3054c7fe58f9d80b0e Mon Sep 17 00:00:00 2001 From: Sebastian Wojciechowski Date: Sun, 7 Oct 2018 11:26:59 +0000 Subject: [PATCH] Remove bodhi-manage-releases Fixes #2420 Signed-off-by: Sebastian Wojciechowski --- bodhi/server/scripts/manage_releases.py | 48 ------- .../server/scripts/test_manage_releases.py | 59 -------- docs/conf.py | 2 - docs/user/3.x_release_notes.rst | 2 +- docs/user/man_pages/bodhi-manage-releases.rst | 130 ------------------ docs/user/man_pages/index.rst | 1 - setup.py | 1 - 7 files changed, 1 insertion(+), 242 deletions(-) delete mode 100644 bodhi/server/scripts/manage_releases.py delete mode 100644 bodhi/tests/server/scripts/test_manage_releases.py delete mode 100644 docs/user/man_pages/bodhi-manage-releases.rst diff --git a/bodhi/server/scripts/manage_releases.py b/bodhi/server/scripts/manage_releases.py deleted file mode 100644 index 1014183488..0000000000 --- a/bodhi/server/scripts/manage_releases.py +++ /dev/null @@ -1,48 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright © 2014-2017 Red Hat, Inc. and others. -# -# This file is part of Bodhi. -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -""" -Create and manage releases in Bodhi. - -Here is an example of creatig a release: - - managereleases.py create --name F23 --long-name "Fedora 23" --id-prefix FEDORA --version 23 - --branch f23 --dist-tag f23 --stable-tag f23-updates --testing-tag f23-updates-testing - --candidate-tag f23-updates-candidate --pending-stable-tag f23-updates-pending - --pending-testing-tag f23-updates-testing-pending --override-tag f23-override --state pending -""" - -import click - -from bodhi.client import cli - - -def main(): - """ - Create and manage releases in Bodhi. - - (This utility has been deprecated. Please use 'bodhi releases' instead.) - """ - click.echo("This utility has been deprecated. Please use 'bodhi releases' instead.") - cli.commands['releases'].commands['create'].params[0].opts = ['--username'] - cli.commands['releases'].commands['edit'].params[0].opts = ['--username'] - cli.commands['releases']() - - -if __name__ == '__main__': - main() diff --git a/bodhi/tests/server/scripts/test_manage_releases.py b/bodhi/tests/server/scripts/test_manage_releases.py deleted file mode 100644 index 3014be1770..0000000000 --- a/bodhi/tests/server/scripts/test_manage_releases.py +++ /dev/null @@ -1,59 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright © 2017 Red Hat, Inc. -# -# This file is part of Bodhi. -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -"""This module contains tests for bodhi.server.scripts.manage_releases.""" -import unittest - -import mock - -from bodhi.server.scripts import manage_releases -from bodhi.client import cli - - -class TestMain(unittest.TestCase): - """ - Test the main() function. - """ - @mock.patch('bodhi.client.releases') - def test_main(self, releases): - """ - Assert correct behavior when main() is called. - """ - try: - result = manage_releases.main() - self.assertEqual(result, ("This utility has been deprecated. ", - "Please use 'bodhi releases' instead.")) - releases.assert_called_once_with() - except SystemExit: - pass - - def test_consistent_username_option(self): - """ - Assert consistency of '--username' option for `bodhi-manage-releases` - after it's modification to '--user' in `bodhi releases`. - """ - self.assertEqual(cli.commands['releases'].commands['create'].params[0].opts, ['--user']) - self.assertEqual(cli.commands['releases'].commands['edit'].params[0].opts, ['--user']) - - try: - manage_releases.main() - except SystemExit: - pass - - self.assertEqual(cli.commands['releases'].commands['create'].params[0].opts, ['--username']) - self.assertEqual(cli.commands['releases'].commands['edit'].params[0].opts, ['--username']) diff --git a/docs/conf.py b/docs/conf.py index 6440767639..df37a47a7a 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -253,8 +253,6 @@ ['Randy Barlow'], 1), ('user/man_pages/bodhi-dequeue-stable', 'bodhi-dequeue-stable', u'move batched updates to stable', ['Randy Barlow'], 1), - ('user/man_pages/bodhi-manage-releases', 'bodhi-manage-releases', u'manage releases', - ['Randy Barlow'], 1), ('user/man_pages/bodhi-monitor-composes', 'bodhi-monitor-composes', u'display a compose report', ['Randy Barlow'], 1), ('user/man_pages/bodhi-push', 'bodhi-push', u'push Fedora updates', ['Randy Barlow'], 1), diff --git a/docs/user/3.x_release_notes.rst b/docs/user/3.x_release_notes.rst index 50bbf5db2f..47289a96de 100644 --- a/docs/user/3.x_release_notes.rst +++ b/docs/user/3.x_release_notes.rst @@ -783,7 +783,7 @@ Features * The :doc:`update_states` are now documented (:commit:`6f4a48a4`). * A :doc:`testing` doc was written (:commit:`f1f2d011`). * A man page for :doc:`man_pages/bodhi-expire-overrides` was written (:commit:`e4402a32`). -* A man page for :doc:`man_pages/bodhi-manage-releases` was written (:commit:`84d01668`). +* A man page for ``bodhi-manage-releases`` was written (:commit:`84d01668`). * Update status and request fields are now indexed for more performant searching (:commit:`768ccb6c`). * ``updateinfo.xml`` now includes the severity level on security updates (:commit:`8c9c1bf9`). diff --git a/docs/user/man_pages/bodhi-manage-releases.rst b/docs/user/man_pages/bodhi-manage-releases.rst deleted file mode 100644 index 0868b8de98..0000000000 --- a/docs/user/man_pages/bodhi-manage-releases.rst +++ /dev/null @@ -1,130 +0,0 @@ -===================== -bodhi-manage-releases -===================== - -Synopsis -======== - -``bodhi-manage-releases`` COMMAND [OPTIONS] [ARGS]... - - -Description -=========== - -DEPRECATED: This utility has been deprecated. Please use ``bodhi releases`` instead. - -``bodhi-manage-releases`` is used by Bodhi administrators to create or edit releases in Bodhi. It -can also be used to list information about an existing release. - - -Options -======= - -Most of the commands will accept these options: - -``--help`` - - Show help text and exit. - -``--url `` - - Use the Bodhi server at the given URL instead of the default server. This can also be set with - the ``BODHI_URL`` environment variable. - - -Commands -======== - -There are three commands, ``create``, ``edit`` and ``info``. - - -create/edit ------------ - -The ``create`` command allows administrators to create new releases in Bodhi. The ``edit`` command -allows administrators to edit existing releases. They both support the following options, with the -exception that only ``edit`` supports ``--new-name``: - -``--branch TEXT`` - - The git branch that corresponds to this release (e.g., f29). - -``--candidate-tag TEXT`` - - The Koji tag to use to search for update candidates (e.g., f29-updates-candidate). - -``--dist-tag TEXT`` - - The Koji dist tag for this release (e.g., f29). - -``--id-prefix TEXT`` - - The release's prefix (e.g., FEDORA). - -``--long-name TEXT`` - - The long name of the release (e.g., Fedora 29). - -``--name TEXT`` - - The name of the release (e.g., F29). - -``--new-name`` - - Change the release's name to a new value (e.g., F29). Only supported by ``edit``, and not - ``create.`` - -``--override-tag TEXT`` - - The Koji tag to use for buildroot overrides (e.g., f29-override). - -``--password TEXT`` - - The password to use when authenticating to Bodhi. - -``--pending-stable-tag TEXT`` - - The Koji tag to use on updates that are marked stable (e.g., f29-updates-pending). - -``--pending-testing-tag TEXT`` - - The Koji tag to use on updates that are pending testing (e.g., f29-updates-testing-pending). - -``--stable-tag TEXT`` - - The Koji tag to use for stable updates (e.g., f29-updates). - -``--state [disabled|pending|current|archived]`` - - The state of the release. - -``--testing-tag TEXT`` - - The Koji tag to use for testing updates (e.g., f29-updates-testing). - -``--username TEXT`` - - The username to use when authenticating to Bodhi. - -``--version TEXT`` - - The version of the release (e.g., 29). - - -info -==== - -``bodhi-manage-releases info RELEASE_NAME`` - -The ``info`` command prints information about the given release. - - -Help -==== - -If you find bugs in bodhi (or in the man page), please feel free to file a bug report or a pull -request:: - - https://github.com/fedora-infra/bodhi - -Bodhi's documentation is available online: https://bodhi.fedoraproject.org/docs diff --git a/docs/user/man_pages/index.rst b/docs/user/man_pages/index.rst index a0135e6e91..bb542b775f 100644 --- a/docs/user/man_pages/index.rst +++ b/docs/user/man_pages/index.rst @@ -11,7 +11,6 @@ Man pages bodhi-clean-old-mashes bodhi-dequeue-stable bodhi-expire-overrides - bodhi-manage-releases bodhi-monitor-composes bodhi-push bodhi-sar diff --git a/setup.py b/setup.py index b8262cab89..5da701ccce 100644 --- a/setup.py +++ b/setup.py @@ -164,7 +164,6 @@ def get_requirements(requirements_file='requirements.txt'): bodhi-monitor-composes = bodhi.server.scripts.monitor_composes:monitor bodhi-untag-branched = bodhi.server.scripts.untag_branched:main bodhi-approve-testing = bodhi.server.scripts.approve_testing:main - bodhi-manage-releases = bodhi.server.scripts.manage_releases:main bodhi-check-policies = bodhi.server.scripts.check_policies:check bodhi-skopeo-lite = bodhi.server.scripts.skopeo_lite:main bodhi-sar = bodhi.server.scripts.sar:get_user_data