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 9b3f9bdc05
commit 0b57c30b24

View File

@@ -22,8 +22,6 @@ Weighing Functions.
import json
import operator
import M2Crypto
from novaclient import v1_1 as novaclient
from novaclient import exceptions as novaclient_exceptions
from nova import crypto
@@ -43,11 +41,6 @@ FLAGS = flags.FLAGS
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):
"""Scheduler that can work across any nova deployment, from simple
deployments to multiple nested zones.
@@ -185,19 +178,16 @@ class DistributedScheduler(driver.Scheduler):
or None if invalid. Broken out for testing.
"""
decryptor = crypto.decryptor(FLAGS.build_plan_encryption_key)
try:
json_entry = decryptor(blob)
# Extract our WeightedHost values
wh_dict = json.loads(json_entry)
host = wh_dict.get('host', None)
blob = wh_dict.get('blob', None)
zone = wh_dict.get('zone', None)
return least_cost.WeightedHost(wh_dict['weight'],
host_state=host_manager.HostState(host, 'compute'),
blob=blob, zone=zone)
json_entry = decryptor(blob)
except M2Crypto.EVP.EVPError:
raise InvalidBlob()
# Extract our WeightedHost values
wh_dict = json.loads(json_entry)
host = wh_dict.get('host', None)
blob = wh_dict.get('blob', None)
zone = wh_dict.get('zone', None)
return least_cost.WeightedHost(wh_dict['weight'],
host_state=host_manager.HostState(host, 'compute'),
blob=blob, zone=zone)
def _ask_child_zone_to_create_instance(self, context, weighted_host,
request_spec, kwargs):