I found a testcase bug in nova/tests/api/openstack/compute/plugins/v3/test_availability_zone.py
def test_create_instance_with_availability_zone(self):
def create(*args, **kwargs):
self.assertIn('availability_zone', kwargs)
return old_create(*args, **kwargs)
old_create = compute_api.API.create
self.stubs.Set(compute_api.API, 'create', create)
image_href = '76fa36fc-c930-4bf3-8c8a-ea2a2420deb6'
flavor_ref = 'http://localhost/v3/flavors/3'
body = {
'server': {
'name': 'config_drive_test',
'image_ref': image_href,
'flavor_ref': flavor_ref,
'metadata': {
'hello': 'world',
'open': 'stack',
},
★ 'availability_zone': "nova",★
},
}
req = fakes.HTTPRequestV3.blank('/v3/servers')
req.method = 'POST'
req.body = jsonutils.dumps(body)
req.headers["content-type"] = "application/json"
admin_context = context.get_admin_context()
service1 = db.service_create(admin_context, {'host': 'host1_zones',
'binary': "nova-compute",
'topic': 'compute',
'report_count': 0})
agg = db.aggregate_create(admin_context,
{'name': 'agg1'}, {'availability_zone': 'nova'})★
db.aggregate_host_add(admin_context, agg['id'], 'host1_zones')
The correct request for availability-zone option is 'os-availability-zone:availability_zone'.
Fix proposed to branch: master /review. openstack. org/67825
Review: https:/