Thanks for reporting this bug. It is legit, but it needs to be discussed
as the RequestSpec.from_primitives method is deprecated and should be
removed at some point. So we need to discuss whether it is worth fixing
or simply removing the method.

** Changed in: nova
       Status: New => Opinion

-- 
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/2008461

Title:
  Creating RequestSpec from flavor tries to use nonexistent attribute

Status in OpenStack Compute (nova):
  Opinion

Bug description:
  Description
  ===========
  Calling RequestSpec.from_primitives, which in turn calls spec._from_flavor 
ends with "AttributeError: module 'nova.objects' has no attribute 'Flavor'" 
after the check "isinstance(flavor, objects.Flavor)"

  Steps to reproduce
  ==================
  * I directly imported RequestSpec via "from nova.objects.request_spec import 
RequestSpec" for testing purposes
  * I called RequestSpec.from_primitives
  * RequestSpec.from_primitives called RequestSpec._from_flavor to fill the 
missing information
  * RequestSpec._from_flavor performed a check "isinstance(flavor, 
objects.Flavor)", which resulted in the exception

  Expected result
  ===============
  I should have received a RequestSpec object or another error if the data 
provided was incorrect.

  Actual result
  =============
  The exception "AttributeError: module 'nova.objects' has no attribute 
'Flavor'" is raised.

  Traceback:
  RequestSpec.from_primitives(scheduler_connector_nova_rpc._context, 
dictionary_from_json, {})
    File 
"/home/eouser/placement-simulation-tool/venv/lib/python3.10/site-packages/nova/objects/request_spec.py",
 line 331, in from_primitives
      spec._from_flavor(flavor)
    File 
"/home/eouser/placement-simulation-tool/venv/lib/python3.10/site-packages/nova/objects/request_spec.py",
 line 249, in _from_flavor
      if isinstance(flavor, objects.Flavor):
  AttributeError: module 'nova.objects' has no attribute 'Flavor'

  Environment
  ===========
  I use Nova 21.2.4 from PyPi, Python 3.10 on Ubuntu 20.04.

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


-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to     : yahoo-eng-team@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to