diff options
author | Rick Harris <rconradharris@gmail.com> | 2013-04-30 21:17:40 +0000 |
---|---|---|
committer | Rick Harris <rconradharris@gmail.com> | 2013-05-01 16:03:15 +0000 |
commit | 2ec71d4cd10d961b64fec984d7b4f15dac597347 (patch) | |
tree | bbc087f95ff5f208bf3e3c56e35b2779bfd8bb23 /tools | |
parent | 8c964a25a0904f4153eb4fbcfb3cfd4d8a357e0c (diff) | |
download | oslo-2ec71d4cd10d961b64fec984d7b4f15dac597347.tar.gz oslo-2ec71d4cd10d961b64fec984d7b4f15dac597347.tar.xz oslo-2ec71d4cd10d961b64fec984d7b4f15dac597347.zip |
Use optparse for install_venv_common
In order to bootstrap a virtualenv from an unmodified 2.6 Python environment,
we need to use optparse instead of argparse or openstack.common.cfg.
Fixes bug 1174926
Change-Id: Iad636c7adf7b184756eeba5ca760d8a76fc0e354
Diffstat (limited to 'tools')
-rw-r--r-- | tools/install_venv_common.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/tools/install_venv_common.py b/tools/install_venv_common.py index f0a1722..0401a95 100644 --- a/tools/install_venv_common.py +++ b/tools/install_venv_common.py @@ -18,10 +18,13 @@ """Provides methods needed by installation script for OpenStack development virtual environments. +Since this script is used to bootstrap a virtualenv from the system's Python +environment, it should be kept strictly compatible with Python 2.6. + Synced in from openstack-common """ -import argparse +import optparse import os import subprocess import sys @@ -131,12 +134,12 @@ class InstallVenv(object): def parse_args(self, argv): """Parses command-line arguments.""" - parser = argparse.ArgumentParser() - parser.add_argument('-n', '--no-site-packages', - action='store_true', - help="Do not inherit packages from global Python " - "install") - return parser.parse_args(argv[1:]) + parser = optparse.OptionParser() + parser.add_option('-n', '--no-site-packages', + action='store_true', + help="Do not inherit packages from global Python " + "install") + return parser.parse_args(argv[1:])[0] class Distro(InstallVenv): |