diff options
author | Thomas Schreiber <tom@rizu.mu> | 2013-02-20 09:46:57 +0100 |
---|---|---|
committer | Thomas Schreiber <tom@rizu.mu> | 2013-02-20 23:17:49 +0100 |
commit | 68e6af73bafde67894780e5d2317084847109edf (patch) | |
tree | af1121d5d7bad6f11901ac7fc90fa3e6e74b612e /tools | |
parent | f35635be470b29398a267d1bc92fac3af46e851f (diff) | |
download | python-novaclient-68e6af73bafde67894780e5d2317084847109edf.tar.gz |
A minimum of Python3 fixes so that installation works without errors/warnings.
Fixes bug: 1130937
Change-Id: I740652fcd5804fc1c120fc409afdf4693c8e5781
Diffstat (limited to 'tools')
-rw-r--r-- | tools/install_venv.py | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/tools/install_venv.py b/tools/install_venv.py index 6cb3a693..953e74bf 100644 --- a/tools/install_venv.py +++ b/tools/install_venv.py @@ -22,6 +22,7 @@ Installation script for Nova's development virtualenv """ +from __future__ import print_function import optparse import os import subprocess @@ -37,7 +38,7 @@ PY_VERSION = "python%s.%s" % (sys.version_info[0], sys.version_info[1]) def die(message, *args): - print >> sys.stderr, message % args + print(message % args, file=sys.stderr) sys.exit(1) @@ -77,12 +78,12 @@ class Distro(object): return if self.check_cmd('easy_install'): - print 'Installing virtualenv via easy_install...', + print('Installing virtualenv via easy_install...') if run_command(['easy_install', 'virtualenv']): - print 'Succeeded' + print('Succeeded') return else: - print 'Failed' + print('Failed') die('ERROR: virtualenv not found.\n\nDevelopment' ' requires virtualenv, please install it using your' @@ -162,17 +163,17 @@ def create_virtualenv(venv=VENV, no_site_packages=True): """Creates the virtual environment and installs PIP only into the virtual environment """ - print 'Creating venv...', + print('Creating venv...') if no_site_packages: run_command(['virtualenv', '-q', '--no-site-packages', VENV]) else: run_command(['virtualenv', '-q', VENV]) - print 'done.' - print 'Installing pip in virtualenv...', + print('done.') + print('Installing pip in virtualenv...') if not run_command(['tools/with_venv.sh', 'easy_install', 'pip>1.0']).strip(): die("Failed to install pip.") - print 'done.' + print('done.') def pip_install(*args): @@ -182,7 +183,7 @@ def pip_install(*args): def install_dependencies(venv=VENV): - print 'Installing dependencies with pip (this can take a while)...' + print('Installing dependencies with pip (this can take a while)...') # First things first, make sure our venv has the latest pip and distribute. pip_install('pip') @@ -221,7 +222,7 @@ def print_help(): Also, make test will automatically use the virtualenv. """ - print help + print(help) def parse_args(): |