Repository: fedora-infra/bodhi

Issue:
Remove bodhi-manage-releases
This should not be done until there is a release with #2419. Once that exists, we should remove the old ```bodhi-manage-releases``` CLI.
Remove bodhi-manage-releases
This should not be done until there is a release with #2419. Once that exists, we should remove the old ```bodhi-manage-releases``` CLI.


Discussion:
@bowlofeggs Since #2419 is closed, can remove bodhi-manage-releases?
@bowlofeggs Since #2419 is closed, can remove bodhi-manage-releases?

Resolving patch:
diff --git a/bodhi/server/scripts/manage_releases.py b/bodhi/server/scripts/manage_releases.py
deleted file mode 100644
--- a/bodhi/server/scripts/manage_releases.py
+++ /dev/null
@@ -1,47 +0,0 @@
-# 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/docs/conf.py b/docs/conf.py
--- 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/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -158,7 +158,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


Test patch:
diff --git a/bodhi/tests/server/scripts/test_manage_releases.py b/bodhi/tests/server/scripts/test_manage_releases.py
deleted file mode 100644
--- a/bodhi/tests/server/scripts/test_manage_releases.py
+++ /dev/null
@@ -1,58 +0,0 @@
-# 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 mock
-import unittest
-
-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'])