File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed
systemvm/debian/opt/cloud/bin Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change 1818
1919STATUS=UNKNOWN
2020
21- ROUTER_TYPE=$( cat /etc/cloudstack/cmdline.json | grep type | awk ' {print $2;}' | sed -e ' s/[,\"]//g' )
22- if [ " $ROUTER_TYPE " = " vpcrouter" ]; then
23- GUEST_NICS=$( python3 -c "
21+ get_guest_nics () {
22+ python3 -c "
2423import json
2524data = json.load(open('/etc/cloudstack/ips.json'))
2625for nic, objs in data.items():
27- if isinstance(objs, list):
28- for obj in objs:
29- if obj.get('nw_type') == 'guest' and obj.get('add'):
30- print(nic)
31- " )
26+ if isinstance(objs, list):
27+ for obj in objs:
28+ if obj.get('nw_type') == 'guest' and obj.get('add'):
29+ print(nic)
30+ "
31+ }
32+
33+ ROUTER_TYPE=$( cat /etc/cloudstack/cmdline.json | grep type | awk ' {print $2;}' | sed -e ' s/[,\"]//g' )
34+ if [ " $ROUTER_TYPE " = " vpcrouter" ]; then
35+ GUEST_NICS=$( get_guest_nics)
3236 if [ " $GUEST_NICS " = " " ]; then
3337 echo " Status: ${STATUS} "
3438 exit
You can’t perform that action at this time.
0 commit comments