From 2ec3ba36bdffa99f5cff9837893d7a697f393ef5 Mon Sep 17 00:00:00 2001 From: Wei Zhou Date: Thu, 12 Jan 2017 08:00:44 +0100 Subject: [PATCH 1/3] CLOUDSTACK-9356: FIX Cannot add users in VPC VPN --- .../network/vpn/RemoteAccessVpnManagerImpl.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/server/src/com/cloud/network/vpn/RemoteAccessVpnManagerImpl.java b/server/src/com/cloud/network/vpn/RemoteAccessVpnManagerImpl.java index b473f050e04..2a847147282 100644 --- a/server/src/com/cloud/network/vpn/RemoteAccessVpnManagerImpl.java +++ b/server/src/com/cloud/network/vpn/RemoteAccessVpnManagerImpl.java @@ -521,21 +521,26 @@ public class RemoteAccessVpnManagerImpl extends ManagerBase implements RemoteAcc boolean success = true; - boolean[] finals = new boolean[users.size()]; + Boolean[] finals = new Boolean[users.size()]; for (RemoteAccessVPNServiceProvider element : _vpnServiceProviders) { s_logger.debug("Applying vpn access to " + element.getName()); for (RemoteAccessVpnVO vpn : vpns) { try { String[] results = element.applyVpnUsers(vpn, users); if (results != null) { + int indexUser = -1; for (int i = 0; i < results.length; i++) { - s_logger.debug("VPN User " + users.get(i) + (results[i] == null ? " is set on " : (" couldn't be set due to " + results[i]) + " on ") + vpn); + indexUser ++; + if (indexUser == users.size()) { + indexUser = 0; // results on multiple VPC routers are combined in commit 13eb789, reset user index if one VR is done. + } + s_logger.debug("VPN User " + users.get(indexUser) + (results[i] == null ? " is set on " : (" couldn't be set due to " + results[i]) + " on ") + vpn.getUuid()); if (results[i] == null) { - if (!finals[i]) { - finals[i] = true; + if (finals[indexUser] == null) { + finals[indexUser] = true; } } else { - finals[i] = false; + finals[indexUser] = false; success = false; } } From 0ddcf0b175bbabf3915c9e250dcbe90a8a7ade1e Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Wed, 1 Mar 2017 14:52:13 +0530 Subject: [PATCH 2/3] CLOUDSTACK-9805: Display VR list in network details Displays a VR tab that lists VRs for the network in the detail views for isolated networks, shared networks and for VPCs. Signed-off-by: Rohit Yadav --- ui/index.jsp | 2 +- ui/scripts/network.js | 17 ++++++++++++++++- ui/scripts/system.js | 10 ++++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/ui/index.jsp b/ui/index.jsp index 34f6310f9c9..49290fe95be 100644 --- a/ui/index.jsp +++ b/ui/index.jsp @@ -1818,7 +1818,6 @@ - @@ -1833,6 +1832,7 @@ + diff --git a/ui/scripts/network.js b/ui/scripts/network.js index 428807e4111..569e31db58d 100755 --- a/ui/scripts/network.js +++ b/ui/scripts/network.js @@ -1194,6 +1194,10 @@ hiddenTabs.push('egressRules'); } + if (!isAdmin()) { + hiddenTabs.push("virtualRouters"); + } + return hiddenTabs; }, @@ -1892,6 +1896,11 @@ } }); } + }, + + virtualRouters: { + title: "label.virtual.appliances", + listView: cloudStack.sections.system.subsections.virtualRouters.sections.routerNoGroup.listView } } } @@ -5738,8 +5747,10 @@ tabFilter: function(args) { var hiddenTabs = []; var isRouterOwner = isAdmin(); - if (!isRouterOwner) + if (!isRouterOwner) { hiddenTabs.push("router"); + hiddenTabs.push("virtualRouters"); + } return hiddenTabs; }, @@ -5905,6 +5916,10 @@ } }); } + }, + virtualRouters: { + title: "label.virtual.routers", + listView: cloudStack.sections.system.subsections.virtualRouters.sections.routerNoGroup.listView } } } diff --git a/ui/scripts/system.js b/ui/scripts/system.js index 98403ed9cf6..b55ca0dcfa0 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -9769,6 +9769,16 @@ domainid: args.context.routerGroupByAccount[0].domainid }) } + if ("networks" in args.context) { + $.extend(data2, { + networkid: args.context.networks[0].id + }) + } + if ("vpc" in args.context) { + $.extend(data2, { + vpcid: args.context.vpc[0].id + }) + } } var routers =[]; From e5bfffb48cff9025c33da661c0ec6055631c4a6b Mon Sep 17 00:00:00 2001 From: Abhinandan Prateek Date: Mon, 3 Apr 2017 16:16:21 +0530 Subject: [PATCH 3/3] CLOUDSTACK-9857: With this change if agent dies the systemd will catch it properly and show process as exited Signed-off-by: Rohit Yadav --- packaging/centos63/cloud-agent.rc | 1 + packaging/centos7/cloud-agent.rc | 1 + packaging/fedora20/cloud-agent.rc | 1 + packaging/fedora21/cloud-agent.rc | 1 + 4 files changed, 4 insertions(+) diff --git a/packaging/centos63/cloud-agent.rc b/packaging/centos63/cloud-agent.rc index aad95828f6d..870a35aef90 100755 --- a/packaging/centos63/cloud-agent.rc +++ b/packaging/centos63/cloud-agent.rc @@ -2,6 +2,7 @@ # chkconfig: 35 99 10 # description: Cloud Agent +# pidfile: /var/run/cloudstack-agent.pid # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file diff --git a/packaging/centos7/cloud-agent.rc b/packaging/centos7/cloud-agent.rc index aad95828f6d..870a35aef90 100755 --- a/packaging/centos7/cloud-agent.rc +++ b/packaging/centos7/cloud-agent.rc @@ -2,6 +2,7 @@ # chkconfig: 35 99 10 # description: Cloud Agent +# pidfile: /var/run/cloudstack-agent.pid # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file diff --git a/packaging/fedora20/cloud-agent.rc b/packaging/fedora20/cloud-agent.rc index 6cc6abc5e5f..2defa148883 100755 --- a/packaging/fedora20/cloud-agent.rc +++ b/packaging/fedora20/cloud-agent.rc @@ -2,6 +2,7 @@ # chkconfig: 35 99 10 # description: Cloud Agent +# pidfile: /var/run/cloudstack-agent.pid # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file diff --git a/packaging/fedora21/cloud-agent.rc b/packaging/fedora21/cloud-agent.rc index 6cc6abc5e5f..2defa148883 100755 --- a/packaging/fedora21/cloud-agent.rc +++ b/packaging/fedora21/cloud-agent.rc @@ -2,6 +2,7 @@ # chkconfig: 35 99 10 # description: Cloud Agent +# pidfile: /var/run/cloudstack-agent.pid # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file