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
This commit is contained in:
Eric Harney 2020-07-27 10:48:27 -04:00
parent 2f600816a1
commit e89dfb0eab
3 changed files with 5 additions and 97 deletions

View File

@ -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='<bpython|ipython|python>',
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,
}

View File

@ -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 <path/scriptname>``
Runs the named script from the specified path with flags set.
Cinder Volume
~~~~~~~~~~~~~

View File

@ -0,0 +1,5 @@
---
upgrade:
- |
The "cinder-manage shell" set of commands has been removed.