summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.bzrignore8
-rw-r--r--nova/CA/openssl.cnf.tmpl6
-rw-r--r--nova/api/ec2/cloud.py5
-rw-r--r--nova/crypto.py2
-rw-r--r--nova/tests/test_cloud.py14
5 files changed, 26 insertions, 9 deletions
diff --git a/.bzrignore b/.bzrignore
index b751ad825..14d8028f7 100644
--- a/.bzrignore
+++ b/.bzrignore
@@ -5,13 +5,7 @@ _trial_temp
keys
networks
nova.sqlite
-CA/cacert.pem
-CA/crl.pem
-CA/index.txt*
-CA/openssl.cnf
-CA/serial*
-CA/newcerts/*.pem
-CA/private/cakey.pem
+CA
nova/vcsversion.py
*.DS_Store
.project
diff --git a/nova/CA/openssl.cnf.tmpl b/nova/CA/openssl.cnf.tmpl
index dd81f1c2b..b80fadf40 100644
--- a/nova/CA/openssl.cnf.tmpl
+++ b/nova/CA/openssl.cnf.tmpl
@@ -41,9 +41,13 @@ nameopt = default_ca
certopt = default_ca
policy = policy_match
+# NOTE(dprince): stateOrProvinceName must be 'supplied' or 'optional' to
+# work around a stateOrProvince printable string UTF8 mismatch on
+# RHEL 6 and Fedora 14 (using openssl-1.0.0-4.el6.x86_64 or
+# openssl-1.0.0d-1.fc14.x86_64)
[ policy_match ]
countryName = match
-stateOrProvinceName = match
+stateOrProvinceName = supplied
organizationName = optional
organizationalUnitName = optional
commonName = supplied
diff --git a/nova/api/ec2/cloud.py b/nova/api/ec2/cloud.py
index 651ec47f9..5e81878c4 100644
--- a/nova/api/ec2/cloud.py
+++ b/nova/api/ec2/cloud.py
@@ -142,6 +142,11 @@ class CloudController(object):
instance_ref = self.compute_api.get_all(ctxt, fixed_ip=address)
if instance_ref is None:
return None
+
+ # This ensures that all attributes of the instance
+ # are populated.
+ instance_ref = db.instance_get(ctxt, instance_ref['id'])
+
mpi = self._get_mpi_data(ctxt, instance_ref['project_id'])
if instance_ref['key_name']:
keys = {'0': {'_name': instance_ref['key_name'],
diff --git a/nova/crypto.py b/nova/crypto.py
index 9b1897926..605be2a32 100644
--- a/nova/crypto.py
+++ b/nova/crypto.py
@@ -232,7 +232,7 @@ def generate_vpn_files(project_id):
genvpn_sh_path = os.path.join(os.path.dirname(__file__),
'CA',
- 'geninter.sh')
+ 'genvpn.sh')
if os.path.exists(crt_fn):
return
_ensure_project_folder(project_id)
diff --git a/nova/tests/test_cloud.py b/nova/tests/test_cloud.py
index 5f76a9005..c45bdd12c 100644
--- a/nova/tests/test_cloud.py
+++ b/nova/tests/test_cloud.py
@@ -36,6 +36,7 @@ from nova import rpc
from nova import service
from nova import test
from nova import utils
+from nova import exception
from nova.auth import manager
from nova.compute import power_state
from nova.api.ec2 import cloud
@@ -372,6 +373,19 @@ class CloudTestCase(test.TestCase):
LOG.debug(_("Terminating instance %s"), instance_id)
rv = self.compute.terminate_instance(instance_id)
+ def test_terminate_instances(self):
+ inst1 = db.instance_create(self.context, {'reservation_id': 'a',
+ 'image_id': 1,
+ 'host': 'host1'})
+ terminate_instances = self.cloud.terminate_instances
+ # valid instance_id
+ result = terminate_instances(self.context, ['i-00000001'])
+ self.assertTrue(result)
+ # non-existing instance_id
+ self.assertRaises(exception.InstanceNotFound, terminate_instances,
+ self.context, ['i-2'])
+ db.instance_destroy(self.context, inst1['id'])
+
def test_update_of_instance_display_fields(self):
inst = db.instance_create(self.context, {})
ec2_id = ec2utils.id_to_ec2_id(inst['id'])