Enforce specific order for firewall.(un)filtered_ports and devices
Enforce specific order for firewall.(un)filtered_ports and devices

Lots of tests in the file rely on specific order of devices and ports
with which they are iterated thru inside firewall implementation. This
is needed to match a regexp against iptables output generated by the
firewall driver.

In production code, those .(un)filtered_ports dictionaries are
unordered, and it would be not wise to enforce the order for them just
for the sake of those unit tests.

Instead, we 'patch' the agent firewall with ordered versions of dict for
those attributes.

Also enforce specific order for device_info dictionaries we pass into
firewall.

The failure was easily reproducible with PYTHONHASHSEED=111, and after
the fix, it's gone.

While at it, stop making assumptions about stable order of dict.values()
between multiple dictionaries with the same keys. It may actually work
for now, but it seems fragile. Overall simplified regex construction
code a bit, f.e. killing some dead or redundant code.

Closes-Bug: #1473413
Change-Id: I170087426bc961592b4c4923c64a5fea30d51c21

adelina-t/neutron,shahbazn/neutron,skyddv/neutron,mmnelemane/neutron,openstack/neutron,suneeth51/neutron,apporc/neutron,huntxu/neutron,suneeth51/neutron,swdream/neutron,sasukeh/neutron,cloudbase/neutron,dhanunjaya/neutron,jumpojoy/neutron,openstack/neutron,yanheven/neutron,noironetworks/neutron,igor-toga/local-snat,shahbazn/neutron,openstack/neutron,eayunstack/neutron,vivekanand1101/neutron,jacknjzhou/neutron,JianyuWang/neutron,silenci/neutron,eayunstack/neutron,glove747/liberty-neutron,dims/neutron,vivekanand1101/neutron,igor-toga/local-snat,SamYaple/neutron,sasukeh/neutron,barnsnake351/neutron,mahak/neutron,noironetworks/neutron,asgard-lab/neutron,chitr/neutron,cisco-openstack/neutron,mmnelemane/neutron,takeshineshiro/neutron,watonyweng/neutron,cisco-openstack/neutron,javaos74/neutron,javaos74/neutron,watonyweng/neutron,swdream/neutron,silenci/neutron,wolverineav/neutron,apporc/neutron,skyddv/neutron,bigswitch/neutron,adelina-t/neutron,sebrandon1/neutron,mattt416/neutron,sebrandon1/neutron,SamYaple/neutron,paninetworks/neutron,eonpatapon/neutron,asgard-lab/neutron,wenhuizhang/neutron,eonpatapon/neutron,klmitch/neutron,wolverineav/neutron,paninetworks/neutron,takeshineshiro/neutron,bigswitch/neutron,mahak/neutron,barnsnake351/neutron,MaximNevrov/neutron,wenhuizhang/neutron,yanheven/neutron,dhanunjaya/neutron,huntxu/neutron,MaximNevrov/neutron,JianyuWang/neutron,neoareslinux/neutron,klmitch/neutron,mattt416/neutron,neoareslinux/neutron,chitr/neutron,glove747/liberty-neutron,jacknjzhou/neutron,mahak/neutron,jumpojoy/neutron,dims/neutron,cloudbase/neutron