summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChmouel Boudjnah <chmouel@enovance.com>2014-01-10 21:09:46 +0100
committerChmouel Boudjnah <chmouel@enovance.com>2014-01-11 08:02:25 +0100
commitb29324318500aa7403a6327fe66bf50dbb5faa00 (patch)
tree9d0a9770d9f508104a4e08973153bd02602c0ce4
parent97d945e87995e61920227e5664ee3c55290c6052 (diff)
downloadpython-heatclient-b29324318500aa7403a6327fe66bf50dbb5faa00.tar.gz
Fix some trivial py3 errors
Change-Id: I72334d2ca82057e591dca4fcfa9ef7ecdd3b6878
-rw-r--r--doc/source/conf.py2
-rw-r--r--heatclient/tests/test_shell.py2
-rw-r--r--heatclient/v1/shell.py12
3 files changed, 8 insertions, 8 deletions
diff --git a/doc/source/conf.py b/doc/source/conf.py
index aafb0c1..54f8a9a 100644
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -30,7 +30,7 @@ import os
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.append(os.path.abspath('.'))
-execfile(os.path.join("ext", "gen_ref.py"))
+exec(open(os.path.join("ext", "gen_ref.py")).read())
# -- General configuration ----------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
diff --git a/heatclient/tests/test_shell.py b/heatclient/tests/test_shell.py
index 8a78e5e..1bbb385 100644
--- a/heatclient/tests/test_shell.py
+++ b/heatclient/tests/test_shell.py
@@ -56,7 +56,7 @@ class TestCase(testtools.TestCase):
# required for testing with Python 2.6
def assertRegexpMatches(self, text, expected_regexp, msg=None):
"""Fail the test unless the text matches the regular expression."""
- if isinstance(expected_regexp, basestring):
+ if isinstance(expected_regexp, six.string_types):
expected_regexp = re.compile(expected_regexp)
if not expected_regexp.search(text):
msg = msg or "Regexp didn't match"
diff --git a/heatclient/v1/shell.py b/heatclient/v1/shell.py
index 4784791..698f234 100644
--- a/heatclient/v1/shell.py
+++ b/heatclient/v1/shell.py
@@ -361,9 +361,9 @@ def do_template_show(hc, args):
raise exc.CommandError('Stack not found: %s' % args.id)
else:
if 'heat_template_version' in template:
- print yaml.safe_dump(template, indent=2)
+ print(yaml.safe_dump(template, indent=2))
else:
- print jsonutils.dumps(template, indent=2)
+ print(jsonutils.dumps(template, indent=2))
@utils.arg('-u', '--template-url', metavar='<URL>',
@@ -404,7 +404,7 @@ def do_template_validate(hc, args):
_process_environment_and_files(args, fields)
validation = hc.stacks.validate(**fields)
- print jsonutils.dumps(validation, indent=2)
+ print(jsonutils.dumps(validation, indent=2))
@utils.arg('id', metavar='<NAME or ID>',
@@ -471,9 +471,9 @@ def do_resource_template(hc, args):
raise exc.CommandError('Resource %s not found.' % args.resource)
else:
if args.format:
- print utils.format_output(template, format=args.format)
+ print(utils.format_output(template, format=args.format))
else:
- print utils.format_output(template)
+ print(utils.format_output(template))
@utils.arg('id', metavar='<NAME or ID>',
@@ -490,7 +490,7 @@ def do_resource_metadata(hc, args):
raise exc.CommandError('Stack or resource not found: %s %s' %
(args.id, args.resource))
else:
- print jsonutils.dumps(metadata, indent=2)
+ print(jsonutils.dumps(metadata, indent=2))
@utils.arg('id', metavar='<NAME or ID>',