Public bug reported:

ovs-vsctl has a switch for returning json output, which is arguably
better for machine processing, and therefore more suitable for neutron's
OVS agent.

Indeed get_vif_port_set in neutron/agent/linux/ovs_lib.py already uses json 
output.
However, get_vif_port_by_id performs match on the text output from ovs_vsctl.
While it is true that regular expressions are extremely powerful, apparently 
trivial errors in the regular expression itself can lead to errors like [1].

In [1] the evaluation of a regular expression is failing because the name of a 
VIF was not wrapped in double quotes.
Even if the could be worth looking into ovs-vsctl output to understand in which 
cases VIF names are wrapped in quotes and in which not, it is probably better 
to just switch to JSON output as parsing JSON is easier and therefore less 
likely to cause errors.

It is also worth noting that the error in regex parsing [1] causes the
VIF to not be wired triggering the same failure as bug 1253896.


[1]  
http://logs.openstack.org/49/63449/16/experimental/check-tempest-dsvm-neutron-isolated/de067c3/logs/screen-q-agt.txt.gz#_2014-02-16_11_46_14_830

** Affects: neutron
     Importance: Undecided
     Assignee: Salvatore Orlando (salvatore-orlando)
         Status: New


** Tags: ops

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1280827

Title:
  Regex parsing in get_vif_port_by_id is tedious and error-prone

Status in OpenStack Neutron (virtual network service):
  New

Bug description:
  ovs-vsctl has a switch for returning json output, which is arguably
  better for machine processing, and therefore more suitable for
  neutron's OVS agent.

  Indeed get_vif_port_set in neutron/agent/linux/ovs_lib.py already uses json 
output.
  However, get_vif_port_by_id performs match on the text output from ovs_vsctl.
  While it is true that regular expressions are extremely powerful, apparently 
trivial errors in the regular expression itself can lead to errors like [1].

  In [1] the evaluation of a regular expression is failing because the name of 
a VIF was not wrapped in double quotes.
  Even if the could be worth looking into ovs-vsctl output to understand in 
which cases VIF names are wrapped in quotes and in which not, it is probably 
better to just switch to JSON output as parsing JSON is easier and therefore 
less likely to cause errors.

  It is also worth noting that the error in regex parsing [1] causes the
  VIF to not be wired triggering the same failure as bug 1253896.

  
  [1]  
http://logs.openstack.org/49/63449/16/experimental/check-tempest-dsvm-neutron-isolated/de067c3/logs/screen-q-agt.txt.gz#_2014-02-16_11_46_14_830

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1280827/+subscriptions

-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to