[ROUTER] Add forceencaps field to python router ipsec config method
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/21acc95d Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/21acc95d Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/21acc95d Branch: refs/heads/master Commit: 21acc95d574cf074b22a958946feb34dee9e0c4a Parents: 4a08dbe Author: Michael Andersen <[email protected]> Authored: Wed Dec 23 21:52:22 2015 +0100 Committer: Michael Andersen <[email protected]> Committed: Thu Jan 7 19:27:42 2016 +0100 ---------------------------------------------------------------------- systemvm/patches/debian/config/opt/cloud/bin/configure.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/21acc95d/systemvm/patches/debian/config/opt/cloud/bin/configure.py ---------------------------------------------------------------------- diff --git a/systemvm/patches/debian/config/opt/cloud/bin/configure.py b/systemvm/patches/debian/config/opt/cloud/bin/configure.py index deb4a74..fb82d80 100755 --- a/systemvm/patches/debian/config/opt/cloud/bin/configure.py +++ b/systemvm/patches/debian/config/opt/cloud/bin/configure.py @@ -527,6 +527,7 @@ class CsSite2SiteVpn(CsDataBag): file.addeq(" pfs=%s" % CsHelper.bool_to_yn(obj['dpd'])) file.addeq(" keyingtries=2") file.addeq(" auto=start") + file.addeq(" forceencaps=%s" % CsHelper.bool_to_yn(obj['encap'])) if obj['dpd']: file.addeq(" dpddelay=30") file.addeq(" dpdtimeout=120") @@ -538,9 +539,9 @@ class CsSite2SiteVpn(CsDataBag): file.commit() logging.info("Configured vpn %s %s", leftpeer, rightpeer) CsHelper.execute("ipsec auto --rereadall") - CsHelper.execute("ipsec --add vpn-%s" % rightpeer) + CsHelper.execute("ipsec auto --add vpn-%s" % rightpeer) if not obj['passive']: - CsHelper.execute("ipsec --up vpn-%s" % rightpeer) + CsHelper.execute("ipsec auto --up vpn-%s" % rightpeer) os.chmod(vpnsecretsfile, 0o400) def convert_sec_to_h(self, val):
