← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1270811] Re: Wrong option is used in test_availability.py

 

** Changed in: nova
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1270811

Title:
  Wrong option is used in test_availability.py

Status in OpenStack Compute (Nova):
  Fix Released

Bug description:
  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'.

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1270811/+subscriptions


References