[Libvirt-cim] [PATCH] [TEST] #3 Fix ElementCapabilities/03_forward_errs.py with provider's updated err message

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Wed Mar 11 21:33:44 UTC 2009


>  > >> ERROR   - None
>  > > The error is coming from line no 80 and not from the control stmt 
> added.
>  > > Let me check this.
>  > >>  
>  > >>   So I define a new variable of cs_exp_desc to cover this and call
>  > >> try_assco twice.
>  > >>
>  >
>  > This is because exp_desc is defined outside of main().  main() doesn't
>  > own the exp_desc variable, so it's unable to modify it.
>  >
>  > Instead of defining exp_desc and exp_rc at the top of the file, define
>  > both in main().
>  >
>  > Or, you can do something like the following:
>  >
>  > cs_exp_desc = exp_desc
>  >
>  > curr_cim_rev, changeset = get_provider_version(options.virt, options.ip)
>  > if curr_cim_rev >= libvirt_ec_changes:
>  >      cs_exp_desc = "Referenced domain `wrong' does not exist:" + \
>  >                    " Domain not found"
>  >
>  > try_assoc(instance_cs, cs, exp_rc, cs_exp_desc, options)
>  >
>  > Whichever is fine.
> 
>   I submit a patch like the second option before, and deepti
>   suggested that it's not a good idea to call the try_assoc() twice.
>   I will submit a new patch with define the exp_rc and exp_desc inside
>   of main().
> 
>   Thanks!

With either option, you only call try_assoc() once.  But the first 
option is fine. =)
-- 
Kaitlin Rupert
IBM Linux Technology Center
kaitlin at linux.vnet.ibm.com




More information about the Libvirt-cim mailing list