Merge "Remove more python2 compat code"
This commit is contained in:
commit
5e4e663619
|
@ -29,7 +29,6 @@ from keystoneauth1.identity import v2 as v2_auth
|
|||
from keystoneauth1.identity import v3 as v3_auth
|
||||
from keystoneauth1 import loading
|
||||
from keystoneauth1 import session
|
||||
from oslo_utils import encodeutils
|
||||
from oslo_utils import importutils
|
||||
import requests
|
||||
from urllib import parse as urlparse
|
||||
|
@ -1015,11 +1014,7 @@ class OpenStackHelpFormatter(argparse.HelpFormatter):
|
|||
|
||||
def main():
|
||||
try:
|
||||
if sys.version_info >= (3, 0):
|
||||
OpenStackCinderShell().main(sys.argv[1:])
|
||||
else:
|
||||
OpenStackCinderShell().main([encodeutils.safe_decode(item)
|
||||
for item in sys.argv[1:]])
|
||||
OpenStackCinderShell().main(sys.argv[1:])
|
||||
except KeyboardInterrupt:
|
||||
print("... terminating cinder client", file=sys.stderr)
|
||||
sys.exit(130)
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
|
||||
import collections
|
||||
import os
|
||||
import sys
|
||||
from urllib import parse
|
||||
import uuid
|
||||
|
||||
|
@ -23,7 +22,6 @@ import prettytable
|
|||
import stevedore
|
||||
|
||||
from cinderclient import exceptions
|
||||
from oslo_utils import encodeutils
|
||||
|
||||
|
||||
def arg(*args, **kwargs):
|
||||
|
@ -109,10 +107,7 @@ def isunauthenticated(f):
|
|||
|
||||
|
||||
def _print(pt, order):
|
||||
if sys.version_info >= (3, 0):
|
||||
print(pt.get_string(sortby=order))
|
||||
else:
|
||||
print(encodeutils.safe_encode(pt.get_string(sortby=order)))
|
||||
print(pt.get_string(sortby=order))
|
||||
|
||||
|
||||
def print_list(objs, fields, exclude_unavailable=False, formatters=None,
|
||||
|
@ -258,9 +253,6 @@ def find_resource(manager, name_or_id, **kwargs):
|
|||
except (ValueError, exceptions.NotFound):
|
||||
pass
|
||||
|
||||
if sys.version_info <= (3, 0):
|
||||
name_or_id = encodeutils.safe_decode(name_or_id)
|
||||
|
||||
try:
|
||||
try:
|
||||
resource = getattr(manager, 'resource_class', None)
|
||||
|
|
Loading…
Reference in New Issue