1
0
mirror of https://github.com/CumulusNetworks/ifupdown2.git synced 2024-05-06 15:54:50 +00:00

ifupdown2: clagd: check clag service restart status and print warning if

not running

Ticket: CM-8211
Reviewed By: CCR-3876
Testing Done: Tested clagd parameters change from ifupdown2

$ifquery bond10.4094
auto bond10.4094
iface bond10.4094
    address 169.254.0.27/24
    clagd-peer-ip 169.254.0.28
    clagd-sys-mac 44:38:39:ff:40:94
    clagd-backup-ip 172.27.28.1
    clagd-priority 4096
    clagd-args --peerTimeout 4o

$ifup -v  bond10.4094
info: Executing /usr/sbin/service clagd restart
info: executing /usr/sbin/service clagd status
[FAIL] clagd is not running ... failed!
warning: bond10.4094: clagd failed to start..Please check clagd log for
details

$tail -f /var/log/clagd.log
2015-11-25T22:14:44.014582+00:00 cel-redxp-06 clagd[30875]: Invoked
with: /usr/sbin/clagd --daemon 169.254.0.28 bond10.4094
44:38:39:ff:40:94 --priority 4096 --backupIp 172.27.28.1 --peerTimeout
4o
2015-11-25T22:14:44.020579+00:00 cel-redxp-06 clagd[30875]: There was an
error in the command line parameters.
2015-11-25T22:14:44.020609+00:00 cel-redxp-06 clagd[30875]: argument
--peerTimeout/-t: invalid int value: '4o'
2015-11-25T22:14:44.020618+00:00 cel-redxp-06 clagd[30875]: exit with
status -1

(cherry picked from commit ac4f4a129a9125eeaf17a48a200ad8ac44bf7ef6)

Conflicts:
	packages/clag/ifupdown/clagd.py
This commit is contained in:
Roopa Prabhu
2015-11-25 14:12:14 -08:00
committed by Sam Tannous
parent cfa06db648
commit 200453838b

View File

@ -29,3 +29,16 @@ class systemUtils():
return True
return False
@classmethod
def check_service_status(cls, servicename=None):
if not servicename:
return False
utilsobj = utilsBase()
try:
utilsobj.subprocess_check_call(['/usr/sbin/service',
'%s' %servicename, 'status'])
except Exception:
# XXX: check for subprocess errors vs os error
return False
return True