argos83 / pysphere

Automatically exported from code.google.com/p/pysphere
88 stars 76 forks source link

PerfCompositeMetric instance has attribute 'entity' and ChildEntity #27

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago

I could see an attribute check in method "get_entity_statistic" of 
vi_performance_manager.py

if composite:
            if hasattr(query, "Entity"):
                stats.extend(query.Entity.Value)
            if hasattr(query, "ChildEntity"):
                for item in query.ChildEntity:
                    stats.extend(item.Value)
        else:
            if hasattr(query[0], "Value"):
                stats = query[0].Value

When will happen this situation ???
AttributeError: PerfCompositeMetric instance has no attribute 'entity'
AttributeError: PerfCompositeMetric instance has no attribute 'ChildEntity'

Is this the only way to do it. 

Why can't we check value of attibutes (currentSupported or summarySupported) of 
PerfProviderSummary and proceed.

Original issue reported on code.google.com by sajup...@gmail.com on 26 Nov 2012 at 8:30

GoogleCodeExporter commented 9 years ago
I want to create a Host which gives following errors. How create it ??
AttributeError: PerfCompositeMetric instance has no attribute 'entity'

IF there is no VMs, I will get this error.
AttributeError: PerfCompositeMetric instance has no attribute 'ChildEntity'

Original comment by sajup...@gmail.com on 26 Nov 2012 at 9:56