← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1215958] Re: vim_util get_dynamic_property propSet need not be set - makes vmware driver hard to diagnose

 

** 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/1215958

Title:
  vim_util get_dynamic_property propSet need not be set - makes vmware
  driver hard to diagnose

Status in OpenStack Compute (Nova):
  Fix Released

Bug description:
  
  It is possible for a query for dynamic_property to find no such property. In this case, propSet on the ObjectContent object will not be 'None' it will not even be set. 

  def get_dynamic_property(vim, mobj, type, property_name):
      """Gets a particular property of the Managed Object."""
      obj_content = get_object_properties(vim, None, mobj, type, [property_name])
      if hasattr(obj_content, 'token'):
          vim.CancelRetrievePropertiesEx(token=obj_content.token)
      property_value = None
      if obj_content.objects:
          dynamic_property = obj_content.objects[0].propSet
          if dynamic_property:
              property_value = dynamic_property[0].val
      return property_value

  Salient docs:
  http://pubs.vmware.com/vsphere-51/index.jsp#com.vmware.wssdk.apiref.doc/vmodl.query.PropertyCollector.ObjectContent.html

  Trace from ML thread:
  > > "/opt/stack/nova/nova/virt/vmwareapi/vim_util.py", line 175, in
  > > get_dynamic_property\n    dynamic_property =
  > > obj_content.objects[0].propSet\n', u"AttributeError: ObjectContent
  > > instance has no attribute 'propSet'\n"]

  
  This error will not be a root-cause error, the root cause will be some other misconfiguration but having this particular error in the trace makes diagnostics harder. Fix in such a way that the calling method receives a 'None' or appropriate default return value.

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