mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
VCP : use routerProxy to call checkrouter script
This commit is contained in:
parent
a08c9e7890
commit
251a91f5b3
@ -1349,8 +1349,8 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
|
||||
|
||||
private CheckRouterAnswer execute(CheckRouterCommand cmd) {
|
||||
Connection conn = getConnection();
|
||||
String args = cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP);
|
||||
String result = callHostPlugin(conn, "vmops", "checkRouter", "args", args);
|
||||
String args = "checkrouter.sh " + cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP);
|
||||
String result = callHostPlugin(conn, "vmops", "routerProxy", "args", args);
|
||||
if (result == null || result.isEmpty()) {
|
||||
return new CheckRouterAnswer(cmd, "CheckRouterCommand failed");
|
||||
}
|
||||
|
||||
@ -1,42 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Copyright 2012 Citrix Systems, Inc. Licensed under the
|
||||
# Apache License, Version 2.0 (the "License"); you may not use this
|
||||
# file except in compliance with the License. Citrix Systems, Inc.
|
||||
# reserves all rights not expressly granted by the License.
|
||||
# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
# Automatically generated by addcopyright.py at 04/03/2012
|
||||
|
||||
usage() {
|
||||
printf "Usage:\n %s <domR eth1 ip> \n" $(basename $0) >&2
|
||||
printf " %s <domR eth1 ip> \n" $(basename $0) >&2
|
||||
}
|
||||
|
||||
cert="/root/.ssh/id_rsa.cloud"
|
||||
domRIp=$1
|
||||
shift
|
||||
|
||||
check_gw() {
|
||||
ping -c 1 -n -q $1 > /dev/null
|
||||
if [ $? -gt 0 ]
|
||||
then
|
||||
sleep 1
|
||||
ping -c 1 -n -q $1 > /dev/null
|
||||
fi
|
||||
return $?;
|
||||
}
|
||||
|
||||
|
||||
check_gw "$domRIp"
|
||||
if [ $? -gt 0 ]
|
||||
then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ssh -p 3922 -q -o StrictHostKeyChecking=no -i $cert root@$domRIp "/root/checkrouter.sh"
|
||||
exit $?
|
||||
@ -1419,20 +1419,6 @@ def network_rules(session, args):
|
||||
except:
|
||||
util.SMlog("Failed to network rule !")
|
||||
|
||||
@echo
|
||||
def checkRouter(session, args):
|
||||
sargs = args['args']
|
||||
cmd = sargs.split(' ')
|
||||
cmd.insert(0, "/opt/xensource/bin/getRouterStatus.sh")
|
||||
cmd.insert(0, "/bin/bash")
|
||||
try:
|
||||
txt = util.pread2(cmd)
|
||||
except:
|
||||
util.SMlog(" check router status fail! ")
|
||||
txt = ''
|
||||
|
||||
return txt
|
||||
|
||||
@echo
|
||||
def bumpUpPriority(session, args):
|
||||
sargs = args['args']
|
||||
@ -1462,6 +1448,6 @@ if __name__ == "__main__":
|
||||
"default_network_rules_systemvm":default_network_rules_systemvm,
|
||||
"get_rule_logs_for_vms":get_rule_logs_for_vms,
|
||||
"setLinkLocalIP":setLinkLocalIP, "lt2p_vpn":lt2p_vpn,
|
||||
"cleanup_rules":cleanup_rules, "checkRouter":checkRouter,
|
||||
"cleanup_rules":cleanup_rules,
|
||||
"bumpUpPriority":bumpUpPriority,
|
||||
"kill_copy_process":kill_copy_process})
|
||||
|
||||
@ -44,7 +44,6 @@ create_privatetemplate_from_snapshot.sh=..,0755,/opt/xensource/bin
|
||||
upgrade_snapshot.sh=..,0755,/opt/xensource/bin
|
||||
cloud-clean-vlan.sh=..,0755,/opt/xensource/bin
|
||||
cloud-prepare-upgrade.sh=..,0755,/opt/xensource/bin
|
||||
getRouterStatus.sh=../../../../network/domr/,0755,/opt/xensource/bin
|
||||
bumpUpPriority.sh=../../../../network/domr/,0755,/opt/xensource/bin
|
||||
swift=..,0755,/opt/xensource/bin
|
||||
swiftxen=..,0755,/etc/xapi.d/plugins
|
||||
|
||||
@ -43,7 +43,6 @@ create_privatetemplate_from_snapshot.sh=..,0755,/opt/xensource/bin
|
||||
upgrade_snapshot.sh=..,0755,/opt/xensource/bin
|
||||
cloud-clean-vlan.sh=..,0755,/opt/xensource/bin
|
||||
cloud-prepare-upgrade.sh=..,0755,/opt/xensource/bin
|
||||
getRouterStatus.sh=../../../../network/domr/,0755,/opt/xensource/bin
|
||||
bumpUpPriority.sh=../../../../network/domr/,0755,/opt/xensource/bin
|
||||
swift=..,0755,/opt/xensource/bin
|
||||
swiftxen=..,0755,/etc/xapi.d/plugins
|
||||
|
||||
@ -48,7 +48,6 @@ create_privatetemplate_from_snapshot.sh=..,0755,/opt/xensource/bin
|
||||
upgrade_snapshot.sh=..,0755,/opt/xensource/bin
|
||||
cloud-clean-vlan.sh=..,0755,/opt/xensource/bin
|
||||
cloud-prepare-upgrade.sh=..,0755,/opt/xensource/bin
|
||||
getRouterStatus.sh=../../../../network/domr/,0755,/opt/xensource/bin
|
||||
bumpUpPriority.sh=../../../../network/domr/,0755,/opt/xensource/bin
|
||||
swift=..,0755,/opt/xensource/bin
|
||||
swiftxen=..,0755,/etc/xapi.d/plugins
|
||||
|
||||
2
wscript
2
wscript
@ -4,7 +4,7 @@
|
||||
# the following two variables are used by the target "waf dist"
|
||||
# if you change 'em here, you need to change it also in cloud.spec, add a %changelog entry there, and add an entry in debian/changelog
|
||||
|
||||
VERSION = '3.0.3.2012-06-06T19:22:49Z'
|
||||
VERSION = '3.0.3.2012-06-06T21:28:42Z'
|
||||
APPNAME = 'cloud'
|
||||
|
||||
import shutil,os
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user