From e89dfb0eab9f19a9d305fd35e8e1d1a3d193ced3 Mon Sep 17 00:00:00 2001 From: Eric Harney Date: Mon, 27 Jul 2020 10:48:27 -0400 Subject: [PATCH] Remove "cinder-manage shell" commands - cinder-manage shell - cinder-manage shell bpython - cinder-manage shell ipython - cinder-manage shell python - cinder-manage shell run - cinder-manage shell script These aren't maintained and don't serve any particular purpose in a Cinder deployment. Remove them. Change-Id: I61effa4a7141617ad6971597e9d1d167a4758a5c --- cinder/cmd/manage.py | 74 ------------------- doc/source/cli/cinder-manage.rst | 23 ------ ...-cinder-manage-shell-6d6f42e5a4ee8c5c.yaml | 5 ++ 3 files changed, 5 insertions(+), 97 deletions(-) create mode 100644 releasenotes/notes/remove-cinder-manage-shell-6d6f42e5a4ee8c5c.yaml diff --git a/cinder/cmd/manage.py b/cinder/cmd/manage.py index 45fc102f4b8..db23fd2847c 100644 --- a/cinder/cmd/manage.py +++ b/cinder/cmd/manage.py @@ -128,79 +128,6 @@ def args(*args, **kwargs): return _decorator -class ShellCommands(object): - def bpython(self): - """Runs a bpython shell. - - Falls back to Ipython/python shell if unavailable - """ - self.run('bpython') - - def ipython(self): - """Runs an Ipython shell. - - Falls back to Python shell if unavailable - """ - self.run('ipython') - - def python(self): - """Runs a python shell. - - Falls back to Python shell if unavailable - """ - self.run('python') - - @args('--shell', - metavar='', - help='Python shell') - def run(self, shell=None): - """Runs a Python interactive interpreter.""" - if not shell: - shell = 'bpython' - - if shell == 'bpython': - try: - import bpython - bpython.embed() - except ImportError: - shell = 'ipython' - if shell == 'ipython': - try: - from IPython import embed - embed() - except ImportError: - try: - # Ipython < 0.11 - # Explicitly pass an empty list as arguments, because - # otherwise IPython would use sys.argv from this script. - import IPython - - shell = IPython.Shell.IPShell(argv=[]) - shell.mainloop() - except ImportError: - # no IPython module - shell = 'python' - - if shell == 'python': - import code - try: - # Try activating rlcompleter, because it's handy. - import readline - except ImportError: - pass - else: - # We don't have to wrap the following import in a 'try', - # because we already know 'readline' was imported successfully. - import rlcompleter # noqa - readline.parse_and_bind("tab:complete") - code.interact() - - @args('--path', required=True, help='Script path') - def script(self, path): - """Runs the script from the specified path with flags set properly.""" - exec(compile(open(path).read(), path, 'exec'), locals(), globals()) - - def _db_error(caught_exception): print('%s' % caught_exception) print(_("The above error may show that the database has not " @@ -745,7 +672,6 @@ CATEGORIES = { 'db': DbCommands, 'host': HostCommands, 'service': ServiceCommands, - 'shell': ShellCommands, 'version': VersionCommands, 'volume': VolumeCommands, } diff --git a/doc/source/cli/cinder-manage.rst b/doc/source/cli/cinder-manage.rst index 0f7b5797f72..3a9e1a23ee3 100644 --- a/doc/source/cli/cinder-manage.rst +++ b/doc/source/cli/cinder-manage.rst @@ -111,29 +111,6 @@ Displays cinder errors from log files. Displays cinder the most recent entries from syslog. The optional number argument specifies the number of entries to display (default 10). -Cinder Shell -~~~~~~~~~~~~ - -``cinder-manage shell bpython`` - -Starts a new bpython shell. - -``cinder-manage shell ipython`` - -Starts a new ipython shell. - -``cinder-manage shell python`` - -Starts a new python shell. - -``cinder-manage shell run`` - -Starts a new shell using python. - -``cinder-manage shell script `` - -Runs the named script from the specified path with flags set. - Cinder Volume ~~~~~~~~~~~~~ diff --git a/releasenotes/notes/remove-cinder-manage-shell-6d6f42e5a4ee8c5c.yaml b/releasenotes/notes/remove-cinder-manage-shell-6d6f42e5a4ee8c5c.yaml new file mode 100644 index 00000000000..08e80d6d640 --- /dev/null +++ b/releasenotes/notes/remove-cinder-manage-shell-6d6f42e5a4ee8c5c.yaml @@ -0,0 +1,5 @@ +--- +upgrade: + - | + The "cinder-manage shell" set of commands has been removed. +