yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #38089
[Bug 1477570] Re: VPNaaS: StrongSwanProcess changes DIALECT_MAP from base class at init
** Changed in: neutron
Status: Fix Committed => Fix Released
** Changed in: neutron
Milestone: None => liberty-3
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1477570
Title:
VPNaaS: StrongSwanProcess changes DIALECT_MAP from base class at init
Status in neutron:
Fix Released
Bug description:
__init__ method of StrongSwanProcess [1] changes the DIALECT_MAP the
following way:
def __init__(self, conf, process_id, vpnservice, namespace):
self.DIALECT_MAP['v1'] = 'ikev1'
self.DIALECT_MAP['v2'] = 'ikev2'
super(StrongSwanProcess, self).__init__(conf, process_id,
vpnservice, namespace)
DIALECT_MAP is a class variable of BaseSwanProcess which is a base
class for StrongSwanProcess and OpenSwanProcess [2]. Overwriting class
variables at instance init is not safe and it leads to sideefects,
i.e. when running UTs for both StrongSwanProcess and OpenSwanProcess.
DIALECT_MAP should be instead be redefined in StrongSwanProcess class
namespace.
[1] https://github.com/openstack/neutron-vpnaas/blob/master/neutron_vpnaas/services/vpn/device_drivers/strongswan_ipsec.py#L61
[2] https://github.com/openstack/neutron-vpnaas/blob/master/neutron_vpnaas/services/vpn/device_drivers/ipsec.py#L89
To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1477570/+subscriptions
References