Merged trunk.
This commit is contained in:
@@ -166,7 +166,7 @@ class VpnCommands(object):
|
||||
print address,
|
||||
print vpn['host'],
|
||||
print ec2utils.id_to_ec2_id(vpn['id']),
|
||||
print vpn['state_description'],
|
||||
print vpn['vm_state'],
|
||||
print state
|
||||
else:
|
||||
print None
|
||||
@@ -869,7 +869,7 @@ class VmCommands(object):
|
||||
instance['hostname'],
|
||||
instance['host'],
|
||||
instance['instance_type'].name,
|
||||
instance['state_description'],
|
||||
instance['vm_state'],
|
||||
instance['launched_at'],
|
||||
instance['image_ref'],
|
||||
instance['kernel_id'],
|
||||
@@ -1223,7 +1223,7 @@ class VsaCommands(object):
|
||||
type=vc['instance_type']['name'],
|
||||
fl_ip=floating_addr,
|
||||
fx_ip=fixed_addr,
|
||||
stat=vc['state_description'],
|
||||
stat=vc['vm_state'],
|
||||
host=vc['host'],
|
||||
time=str(vc['created_at']))
|
||||
|
||||
|
||||
@@ -32,6 +32,12 @@ from nova import exception
|
||||
from nova import flags
|
||||
import nova.scheduler
|
||||
|
||||
# NOTE(Vek): Even though we don't use filters in here anywhere, we
|
||||
# depend on default_host_filter being available in FLAGS,
|
||||
# and that happens only when filters/abstract_filter.py is
|
||||
# imported.
|
||||
from nova.scheduler import filters
|
||||
|
||||
|
||||
FLAGS = flags.FLAGS
|
||||
|
||||
|
||||
@@ -161,6 +161,19 @@ class ComputeTestCase(test.TestCase):
|
||||
db.security_group_destroy(self.context, group['id'])
|
||||
db.instance_destroy(self.context, ref[0]['id'])
|
||||
|
||||
def test_create_instance_with_invalid_security_group_raises(self):
|
||||
instance_type = instance_types.get_default_instance_type()
|
||||
|
||||
pre_build_len = len(db.instance_get_all(context.get_admin_context()))
|
||||
self.assertRaises(exception.SecurityGroupNotFoundForProject,
|
||||
self.compute_api.create,
|
||||
self.context,
|
||||
instance_type=instance_type,
|
||||
image_href=None,
|
||||
security_group=['this_is_a_fake_sec_group'])
|
||||
self.assertEqual(pre_build_len,
|
||||
len(db.instance_get_all(context.get_admin_context())))
|
||||
|
||||
def test_create_instance_associates_config_drive(self):
|
||||
"""Make sure create associates a config drive."""
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ from nova import test
|
||||
from nova import utils
|
||||
from nova.api.ec2 import cloud
|
||||
from nova.compute import power_state
|
||||
from nova.compute import vm_states
|
||||
from nova.virt.libvirt import connection
|
||||
from nova.virt.libvirt import firewall
|
||||
|
||||
@@ -674,8 +675,9 @@ class LibvirtConnTestCase(test.TestCase):
|
||||
|
||||
# Preparing data
|
||||
self.compute = utils.import_object(FLAGS.compute_manager)
|
||||
instance_dict = {'host': 'fake', 'state': power_state.RUNNING,
|
||||
'state_description': 'running'}
|
||||
instance_dict = {'host': 'fake',
|
||||
'power_state': power_state.RUNNING,
|
||||
'vm_state': vm_states.ACTIVE}
|
||||
instance_ref = db.instance_create(self.context, self.test_instance)
|
||||
instance_ref = db.instance_update(self.context, instance_ref['id'],
|
||||
instance_dict)
|
||||
@@ -713,8 +715,8 @@ class LibvirtConnTestCase(test.TestCase):
|
||||
self.compute.rollback_live_migration)
|
||||
|
||||
instance_ref = db.instance_get(self.context, instance_ref['id'])
|
||||
self.assertTrue(instance_ref['state_description'] == 'running')
|
||||
self.assertTrue(instance_ref['state'] == power_state.RUNNING)
|
||||
self.assertTrue(instance_ref['vm_state'] == vm_states.ACTIVE)
|
||||
self.assertTrue(instance_ref['power_state'] == power_state.RUNNING)
|
||||
volume_ref = db.volume_get(self.context, volume_ref['id'])
|
||||
self.assertTrue(volume_ref['status'] == 'in-use')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user