← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1525797] Re: vmwareapi get clusters error

 

In nova/nova/virt/vmwareapi/vm_util.py, function get_cluster_ref_by_name 
def get_cluster_ref_by_name(session, cluster_name):
    """Get reference to the vCenter cluster with the specified name."""
    all_clusters = get_all_cluster_mors(session)
    if not all_clusters:
        return {}
    for cluster in all_clusters:
        if (hasattr(cluster, 'propSet') and
                    cluster.propSet[0].val == cluster_name):
            return cluster.obj

** Changed in: nova
       Status: New => 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/1525797

Title:
  vmwareapi get clusters error

Status in OpenStack Compute (nova):
  Fix Released

Bug description:
  In nova/nova/virt/vmwareapi/vm_util.py, function get_cluster_ref_by_name has a Potential bug
      all_clusters = get_all_cluster_mors(session)
      for cluster in all_clusters:
  if all_clusters in None, then this code may cause error: TypeError: 'NoneType' object is not iterable.
  so,you must judge all_clusters is not None type, then do the code : for cluster in all_clusters, otherwise return {}

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


References