libvirt-cim-bounces@redhat.com wrote on 2008-04-01 09:40:04:
> Guo Lian Yun wrote:
> > @@ -67,18 +68,20 @@ def main():
> > def main():
> > options = main.options
> > rc = PASS
> > + log_param()
> >
> > - instanceref = CIMInstanceName("Xen_HostSystem",
> > + instanceref = CIMInstanceName(get_typed_class(options.virt,
> "HostSystem"),
> #1
>
> > keybindings = {"Name" :
> "wrong", "CreationClassName" : "wrong"})
> > - rc = try_assoc(instanceref, "Xen_HostSystem", exp_rc,
> exp_desc, options)
> > + rc = try_assoc(instanceref, get_typed_class(options.virt,
> "HostSystem"), exp_rc, exp_desc, options)
> #2
>
> >
> > if rc != PASS:
> > status = FAIL
> > return status
> >
> > - instance_cs = CIMInstanceName("Xen_ComputerSystem",
> > - keybindings = {"Name" :
> "wrong", "CreationClassName" : "Xen_ComputerSystem"})
> > - rc = try_assoc(instance_cs, "Xen_ComputerSystem", exp_rc,
> exp_desc, options)
> > + instance_cs = CIMInstanceName(get_typed_class(options.virt,
> "ComputerSystem"),
> #3
>
> > + keybindings = {"Name" : "wrong",
> > +
> "CreationClassName" : get_typed_class(options.virt,"ComputerSystem")})
> > + rc = try_assoc(instance_cs, get_typed_class(options.virt,
> "ComputerSystem"), exp_rc, exp_desc, options)
> #4
>
> #1 & #2, #3 & #4 share some common code. I would consider use a variable
> to avoid duplicated get_typed_class() call.
Good catch!
Changed and resubmit.
>
> > if rc != PASS:
> > status = FAIL
> > return status
> >
> > _______________________________________________
> > Libvirt-cim mailing list
> > Libvirt-cim@redhat.com
> > https://www.redhat.com/mailman/listinfo/libvirt-cim
> >
>
>
> --
> - Zhengang
>
> _______________________________________________
> Libvirt-cim mailing list
> Libvirt-cim@redhat.com
> https://www.redhat.com/mailman/listinfo/libvirt-cim