Excise M2Crypto!

This required rewriting our Diffie-Hellman-Merkle implementation for
set_admin_password in xen. Fixes bug 917851.

Change-Id: Ic4cdcc06221f003aec2dcd5ba05a1a9ad19d39c9
This commit is contained in:
Brian Waldon
2012-01-31 20:50:48 -08:00
parent baae80bb48
commit b45c84282a
2 changed files with 12 additions and 28 deletions

View File

@@ -54,22 +54,16 @@ Install the prerequisite packages.
On Ubuntu:: On Ubuntu::
sudo apt-get install python-dev swig libssl-dev python-pip git-core sudo apt-get install python-dev libssl-dev python-pip git-core
On Fedora-based distributions (e.g., Fedora/RHEL/CentOS/Scientific Linux):: On Fedora-based distributions (e.g., Fedora/RHEL/CentOS/Scientific Linux)::
sudo yum install python-devel swig openssl-devel python-pip git sudo yum install python-devel openssl-devel python-pip git
Mac OS X Systems Mac OS X Systems
---------------- ----------------
Install swig, which is needed to build the M2Crypto Python package. If you are
using the `homebrew <http://mxcl.github.com/homebrew/>`_, package manager,
install swig by doing::
brew install swig
Install virtualenv:: Install virtualenv::
sudo easy_install virtualenv sudo easy_install virtualenv
@@ -120,7 +114,7 @@ You can manually install the virtual environment instead of having
This will install all of the Python packages listed in the This will install all of the Python packages listed in the
``tools/pip-requires`` file into your virtualenv. There will also be some ``tools/pip-requires`` file into your virtualenv. There will also be some
additional packages (pip, distribute, greenlet, M2Crypto) that are installed additional packages (pip, distribute, greenlet) that are installed
by the ``tools/install_venv.py`` file into the virutalenv. by the ``tools/install_venv.py`` file into the virutalenv.
If all goes well, you should get a message something like this:: If all goes well, you should get a message something like this::

View File

@@ -22,8 +22,6 @@ Weighing Functions.
import json import json
import operator import operator
import M2Crypto
from novaclient import v1_1 as novaclient from novaclient import v1_1 as novaclient
from novaclient import exceptions as novaclient_exceptions from novaclient import exceptions as novaclient_exceptions
from nova import crypto from nova import crypto
@@ -43,11 +41,6 @@ FLAGS = flags.FLAGS
LOG = logging.getLogger('nova.scheduler.distributed_scheduler') LOG = logging.getLogger('nova.scheduler.distributed_scheduler')
class InvalidBlob(exception.NovaException):
message = _("Ill-formed or incorrectly routed 'blob' data sent "
"to instance create request.")
class DistributedScheduler(driver.Scheduler): class DistributedScheduler(driver.Scheduler):
"""Scheduler that can work across any nova deployment, from simple """Scheduler that can work across any nova deployment, from simple
deployments to multiple nested zones. deployments to multiple nested zones.
@@ -185,8 +178,8 @@ class DistributedScheduler(driver.Scheduler):
or None if invalid. Broken out for testing. or None if invalid. Broken out for testing.
""" """
decryptor = crypto.decryptor(FLAGS.build_plan_encryption_key) decryptor = crypto.decryptor(FLAGS.build_plan_encryption_key)
try:
json_entry = decryptor(blob) json_entry = decryptor(blob)
# Extract our WeightedHost values # Extract our WeightedHost values
wh_dict = json.loads(json_entry) wh_dict = json.loads(json_entry)
host = wh_dict.get('host', None) host = wh_dict.get('host', None)
@@ -196,9 +189,6 @@ class DistributedScheduler(driver.Scheduler):
host_state=host_manager.HostState(host, 'compute'), host_state=host_manager.HostState(host, 'compute'),
blob=blob, zone=zone) blob=blob, zone=zone)
except M2Crypto.EVP.EVPError:
raise InvalidBlob()
def _ask_child_zone_to_create_instance(self, context, weighted_host, def _ask_child_zone_to_create_instance(self, context, weighted_host,
request_spec, kwargs): request_spec, kwargs):
"""Once we have determined that the request should go to one """Once we have determined that the request should go to one