Enable H23* rules in pep/flake (py3-compat)

Basic python 3 compatibility fixies

Change-Id: I97726d42706c538d40cb1662112e56c13432e87f
Related-Bug: #1333290
This commit is contained in:
Valeriy Ponomaryov
2014-06-23 11:51:29 -04:00
parent 493ec0a538
commit dc1926e9ad
10 changed files with 48 additions and 35 deletions

View File

@@ -18,6 +18,8 @@
Command-line interface to the OpenStack Manila API.
"""
from __future__ import print_function
import argparse
import glob
import imp
@@ -427,7 +429,7 @@ class OpenStackManilaShell(object):
commands.remove('bash-completion')
commands.remove('bash_completion')
print ' '.join(commands | options)
print(' '.join(commands | options))
@utils.arg('command', metavar='<subcommand>', nargs='?',
help='Display help for <subcommand>')
@@ -455,14 +457,14 @@ def main():
try:
OpenStackManilaShell().main(map(strutils.safe_decode, sys.argv[1:]))
except KeyboardInterrupt:
print >> sys.stderr, "... terminating manila client"
print("... terminating manila client", file=sys.stderr)
sys.exit(130)
except Exception, e:
except Exception as e:
logger.debug(e, exc_info=1)
message = e.message
if not isinstance(message, basestring):
message = str(message)
print >> sys.stderr, "ERROR: %s" % strutils.safe_encode(message)
print("ERROR: %s" % strutils.safe_encode(message), file=sys.stderr)
sys.exit(1)