summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorChuck Short <chuck.short@canonical.com>2013-06-09 21:24:10 -0500
committerChuck Short <chuck.short@canonical.com>2013-06-12 07:59:44 -0500
commit4b1cdab2fe1c97eadc33f40856d78b5718fd3ed2 (patch)
tree0cd51d3dbed3080d21e7bfbbe8189b124576892a /tools
parent70f95192a996ece377e7e948f7d4e7e2ab30c4ec (diff)
downloadpython-cinderclient-4b1cdab2fe1c97eadc33f40856d78b5718fd3ed2.tar.gz
python3: Basic python3 compatibility.
Basic python3 compatibilty. Change-Id: I4388f5956cf397f8e33d20085aae6c6a728dbbda Signed-off-by: Chuck Short <chuck.short@canonical.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/install_venv.py22
1 files changed, 12 insertions, 10 deletions
diff --git a/tools/install_venv.py b/tools/install_venv.py
index f22c18d..55603d2 100644
--- a/tools/install_venv.py
+++ b/tools/install_venv.py
@@ -22,6 +22,8 @@
Installation script for Nova's development virtualenv
"""
+from __future__ import print_function
+
import optparse
import os
import subprocess
@@ -37,7 +39,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 +79,12 @@ class Distro(object):
return
if self.check_cmd('easy_install'):
- print 'Installing virtualenv via easy_install...',
+ print('Installing virtualenv via easy_install...', end=' ')
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 +164,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...', end=' ')
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...', end=' ')
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 +184,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')
@@ -220,7 +222,7 @@ def print_help():
Also, make test will automatically use the virtualenv.
"""
- print help
+ print(help)
def parse_args():