From 1862fe5ecd5265d963f8e9ec591f8eaa7b51fde3 Mon Sep 17 00:00:00 2001 From: Kost Date: Tue, 18 Jan 2011 14:41:32 -0500 Subject: added paste pastedeploy to nova.sh --- contrib/nova.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/nova.sh b/contrib/nova.sh index a0e8e642c..08dc89bae 100755 --- a/contrib/nova.sh +++ b/contrib/nova.sh @@ -87,6 +87,7 @@ if [ "$CMD" == "install" ]; then sudo apt-get install -y python-twisted python-sqlalchemy python-mox python-greenlet python-carrot sudo apt-get install -y python-daemon python-eventlet python-gflags python-ipy sudo apt-get install -y python-libvirt python-libxml2 python-routes python-cheetah + sudo apt-get install -y python-paste python-pastedeploy #For IPV6 sudo apt-get install -y python-netaddr sudo apt-get install -y radvd -- cgit From 50ec058cc70044a4cfbad97147940a6124aa10a8 Mon Sep 17 00:00:00 2001 From: Soren Hansen Date: Wed, 19 Jan 2011 10:50:54 +0100 Subject: Refactor run_tests.sh to allow us to run an extra command after the tests. Run pep8 after unit tests in run_tests.sh. Fix setup.py to be PEP-8 compliant. --- run_tests.sh | 58 +++++++++++++++++++++++++++++----------------------------- setup.py | 17 +++++++++-------- 2 files changed, 38 insertions(+), 37 deletions(-) diff --git a/run_tests.sh b/run_tests.sh index fe703fece..0574643c5 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -31,46 +31,46 @@ always_venv=0 never_venv=0 force=0 noseargs= - +wrapper="" for arg in "$@"; do process_option $arg done -NOSETESTS="python run_tests.py $noseargs" - -if [ $never_venv -eq 1 ]; then +function run_tests { # Just run the test suites in current environment - rm -f nova.sqlite - $NOSETESTS 2> run_tests.err.log - exit -fi + ${wrapper} rm -f nova.sqlite + ${wrapper} $NOSETESTS 2> run_tests.err.log +} -# Remove the virtual environment if --force used -if [ $force -eq 1 ]; then - echo "Cleaning virtualenv..." - rm -rf ${venv} -fi +NOSETESTS="python run_tests.py $noseargs" -if [ -e ${venv} ]; then - ${with_venv} rm -f nova.sqlite - ${with_venv} $NOSETESTS 2> run_tests.err.log -else - if [ $always_venv -eq 1 ]; then - # Automatically install the virtualenv - python tools/install_venv.py +if [ $never_venv -eq 0 ] +then + # Remove the virtual environment if --force used + if [ $force -eq 1 ]; then + echo "Cleaning virtualenv..." + rm -rf ${venv} + fi + if [ -e ${venv} ]; then + wrapper="${with_venv}" else - echo -e "No virtual environment found...create one? (Y/n) \c" - read use_ve - if [ "x$use_ve" = "xY" -o "x$use_ve" = "x" -o "x$use_ve" = "xy" ]; then - # Install the virtualenv and run the test suite in it + if [ $always_venv -eq 1 ]; then + # Automatically install the virtualenv python tools/install_venv.py + wrapper="${with_venv}" else - rm -f nova.sqlite - $NOSETESTS 2> run_tests.err.log - exit + echo -e "No virtual environment found...create one? (Y/n) \c" + read use_ve + if [ "x$use_ve" = "xY" -o "x$use_ve" = "x" -o "x$use_ve" = "xy" ]; then + # Install the virtualenv and run the test suite in it + python tools/install_venv.py + wrapper=${with_venv} + fi fi fi - ${with_venv} rm -f nova.sqlite - ${with_venv} $NOSETESTS 2> run_tests.err.log fi + +run_tests + +pep8 --repeat --show-pep8 --show-source bin/* nova setup.py diff --git a/setup.py b/setup.py index 3608ff805..65adbe992 100644 --- a/setup.py +++ b/setup.py @@ -41,6 +41,7 @@ class local_BuildDoc(BuildDoc): self.finalize_options() BuildDoc.run(self) + class local_sdist(sdist): """Customized sdist hook - builds the ChangeLog file from VC first""" @@ -57,17 +58,17 @@ class local_sdist(sdist): changelog_file.write(str_dict_replace(changelog, mailmap)) sdist.run(self) -nova_cmdclass= { 'sdist': local_sdist, - 'build_sphinx' : local_BuildDoc } +nova_cmdclass = {'sdist': local_sdist, + 'build_sphinx': local_BuildDoc} try: - from babel.messages import frontend as babel - nova_cmdclass['compile_catalog'] = babel.compile_catalog - nova_cmdclass['extract_messages'] = babel.extract_messages - nova_cmdclass['init_catalog'] = babel.init_catalog - nova_cmdclass['update_catalog'] = babel.update_catalog + from babel.messages import frontend as babel + nova_cmdclass['compile_catalog'] = babel.compile_catalog + nova_cmdclass['extract_messages'] = babel.extract_messages + nova_cmdclass['init_catalog'] = babel.init_catalog + nova_cmdclass['update_catalog'] = babel.update_catalog except: - pass + pass setup(name='nova', version=version.canonical_version_string(), -- cgit From beff00fbe9b9e05e265f3c4ce5b6670426e22de2 Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Wed, 19 Jan 2011 11:20:56 -0800 Subject: make sure params have no unicode keys --- nova/api/direct.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nova/api/direct.py b/nova/api/direct.py index 81b3ae202..509ab3ae0 100644 --- a/nova/api/direct.py +++ b/nova/api/direct.py @@ -196,6 +196,8 @@ class ServiceWrapper(wsgi.Controller): # TODO(termie): do some basic normalization on methods method = getattr(self.service_handle, action) + # NOTE(vish): make sure we have no unicode keys for py2.6. + params = dict([(str(k), v) for (k, v) in params.iteritems()]) result = method(context, **params) if type(result) is dict or type(result) is list: return self._serialize(result, req) -- cgit