[Libvirt-cim] [PATCH] [TEST] Fix HostedService-04_reverse_errs.py with sblim base provider installed
Guo Lian Yun
yunguol at cn.ibm.com
Sat Sep 27 02:19:42 UTC 2008
libvirt-cim-bounces at 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 at linux.vnet.ibm.com
>
> _______________________________________________
> Libvirt-cim mailing list
> Libvirt-cim at redhat.com
> https://www.redhat.com/mailman/listinfo/libvirt-cim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvirt-cim/attachments/20080927/60e099e8/attachment.htm>
More information about the Libvirt-cim
mailing list