[ovs-dev] [PATCH v4] ovs-bugtool: Added --ovs option to get only ovs related information

Ben Pfaff blp at nicira.com
Fri Jul 13 16:38:37 UTC 2012


On Wed, Jul 11, 2012 at 07:41:59PM -0700, Arun Sharma wrote:
> Option --ovs is added for ovs-bugtool command to collect
> only OpenvSwitch relevant information. To perform
> filtering in plugins, a new xml attribute filters="ovs" (optional)
> would be required in element 'command','files','directory' in
> openvswitch.xml. Value of 'filters' attribute will be compared
> with filtering option in load_plugins to get all relevant operation
> to collect information. If no "--ovs" option is passed then it will
> behave as earlier.
> 
> Fixed an issue which occurs in scenario where option '--yestoall'
> is not passed and user keeps entering "y" or "n" on prompt.
> 
> Plus, trailing whitespaces are fixed. White space before '=' and
> after in function def and call is also fixed.
> 
> Signed-off-by: Arun Sharma <arun.sharma at calsoftinc.com>

It looks to me like exactly one of only_ovs_info or collect_all_info
is always set.  Is that true?  If it is, then why would we ever write
"if collect_all_info or only_ovs_info:", as below, since it would
always be true:

> -            for b in bond_list(vspid):
> -                cmd_output(CAP_NETWORK_STATUS,
> -                           [OVS_APPCTL, '-t', '@RUNDIR@/ovs-vswitchd.%s.ctl' % vspid, '-e' 'bond/show %s' % b],
> -                           'ovs-appctl-bond-show-%s.out' % b)
> +            if collect_all_info or only_ovs_info:
> +                for b in bond_list(vspid):
> +                    cmd_output(CAP_NETWORK_STATUS,
> +                               [OVS_APPCTL, '-t',
> +                                '@RUNDIR@/ovs-vswitchd.%s.ctl' % vspid, '-e' 'bond/show %s' % b],
> +                               'ovs-appctl-bond-show-%s.out' % b)
>          except e:
>              pass

This commit changes the plugins, adding a new "filter" attribute.  The
plugins are used not just by ovs-bugtool but also by xen-bugtool on
XenServer.  Will xen-bugtool accept the plugins that have been
modified in this way, or reject them because they have unknown
attributes?

Thanks,

Ben.



More information about the dev mailing list