mirror of https://github.com/apache/cloudstack.git
Persist vpn connection state before restarting (#4635)
If the vpn connection is in pending state then we cant restart the vpn connection. So manually set the state to disconnected and then try to restart the vpn connection
This commit is contained in:
parent
95ef292860
commit
1bf686269f
|
|
@ -610,13 +610,12 @@ public class Site2SiteVpnManagerImpl extends ManagerBase implements Site2SiteVpn
|
|||
}
|
||||
_accountMgr.checkAccess(caller, null, false, conn);
|
||||
|
||||
if (conn.getState() == State.Pending) {
|
||||
conn.setState(State.Disconnected);
|
||||
}
|
||||
if (conn.getState() == State.Connected || conn.getState() == State.Error
|
||||
|| conn.getState() == State.Disconnected || conn.getState() == State.Connecting) {
|
||||
stopVpnConnection(id);
|
||||
}
|
||||
// Set vpn state to disconnected
|
||||
conn.setState(State.Disconnected);
|
||||
_vpnConnectionDao.persist(conn);
|
||||
|
||||
// Stop and start the connection again
|
||||
stopVpnConnection(id);
|
||||
startVpnConnection(id);
|
||||
conn = _vpnConnectionDao.findById(id);
|
||||
return conn;
|
||||
|
|
|
|||
Loading…
Reference in New Issue