StrongSwanProcess: redefine DIALECT_MAP at class level

DIALECT_MAP is a class variable of BaseSwanProcess which is a base
class for StrongSwanProcess and OpenSwanProcess. 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.

Change-Id: I705ea4863a14fc6ecf3e0f16142e4f375c75cd62
Closes-Bug: #1477570
This commit is contained in:
Elena Ezhova 2015-07-23 16:28:46 +03:00
parent d9776ee8ca
commit bbd38e5e16
1 changed files with 3 additions and 0 deletions

View File

@ -64,6 +64,9 @@ class StrongSwanProcess(ipsec.BaseSwanProcess):
# CONNECTING means route created, connection tunnel is negotiating.
# INSTALLED means route created,
# also connection tunnel installed. (traffic can pass)
DIALECT_MAP = dict(ipsec.BaseSwanProcess.DIALECT_MAP)
STATUS_DICT = {
'ROUTED': constants.DOWN,
'CONNECTING': constants.DOWN,