** Changed in: nova/juno
       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/1408480

Title:
  PciDevTracker passes context module instead of instance

Status in OpenStack Compute (nova):
  Fix Released
Status in OpenStack Compute (nova) juno series:
  Fix Released

Bug description:
  Currently, the code in the PciDevTracker.__init__() method of
  nova/pci/manager.py reads:

  ```
      def __init__(self, node_id=None):                                         
                                                                                
                              
          """Create a pci device tracker.                                       
                                                                                
                              
                                                                                
                                                                                
                              
          If a node_id is passed in, it will fetch pci devices information      
                                                                                
                              
          from database, otherwise, it will create an empty devices list        
                                                                                
                              
          and the resource tracker will update the node_id information later.   
                                                                                
                              
          """                                                                   
                                                                                
                              
                                                                                
                                                                                
                              
          super(PciDevTracker, self).__init__()                                 
                                                                                
                              
          self.stale = {}                                                       
                                                                                
                              
          self.node_id = node_id                                                
                                                                                
                              
          self.stats = stats.PciDeviceStats()                                   
                                                                                
                              
          if node_id:                                                           
                                                                                
                              
              self.pci_devs = list(                                             
                                                                                
                              
                  objects.PciDeviceList.get_by_compute_node(context, node_id))  
                                                                                
                              
          else:                                                                 
                                                                                
                              
              self.pci_devs = []                                                
                                                                                
                              
          self._initial_instance_usage()                  
  ```

  The problem is that in the call to
  `objects.PciDeviceList.get_by_compute_node(context, node_id)`, there
  is no local value for the 'context' parameter, so as a result, the
  context module defined in the imports is what is passed.

  Instead, the parameter should be changed to
  `context.get_admin_context()`.

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1408480/+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