libvirt-cim-bounces@redhat.com wrote on 2008-09-27 05:57:48:

> >      rc = -1
> >      status = FAIL
> > -    keys = ['Name', 'CreationClassName']
> > -    try:
> > -        host_sys = enumclass.enumerate(options.ip, 'HostSystem',
> keys, options.virt)[0]
> > -    except Exception:
> > -        logger.error(CIM_ERROR_ENUMERATE % host_sys.name)
> > -        return FAIL
> > +    ret, linux_cs = check_sblim(options.ip, options.virt)
> > +    if ret == PASS:
> > +        host_sys = linux_cs
> > +    else:
> > +        keys = ['Name', 'CreationClassName']
> > +        try:
> > +            host_sys = enumclass.enumerate(options.ip,
> 'HostSystem', keys, options.virt)[0]
> > +        except Exception:
> > +            logger.error(CIM_ERROR_ENUMERATE % host_sys.name)
> > +            return FAIL
>
> You can use get_host_info() instead.
>
> >
> >
> >      servicelist = {get_typed_class(options.virt,
> "ResourcePoolConfigurationService") : "RPCS",
> > @@ -65,7 +70,8 @@ def main():
> >          names = []
> >
> >          try:
> > -            names = conn.AssociatorNames(instanceref, AssocClass
> = get_typed_class(options.virt, "HostedService"))
> > +            names = conn.AssociatorNames(instanceref, AssocClass = \
> > +                    get_typed_class(options.virt, "HostedService"))
>
> The alignment here is a little strange. Usually, you align like the
> following:
>
> names = conn.AssociatorNames(instanceref, AssocClass=\
>                               get_typed_class(options.virt,
> "HostedService"))
>
>
> But instead, I'd suggest doing something like:
>
> hostedserv_cn = get_typed_class(options.virt, "HostedService"))
> names = conn.AssociatorNames(instanceref, AssocClass=hostedserv_cn)


  #3 patch on the way.

  Thanks!
>
> --
> Kaitlin Rupert
> IBM Linux Technology Center
> kaitlin@linux.vnet.ibm.com
>
> _______________________________________________
> Libvirt-cim mailing list
> Libvirt-cim@redhat.com
> https://www.redhat.com/mailman/listinfo/libvirt-cim