Madhuvishy has submitted this change and it was merged.

Change subject: labstore: Update check_drbd_role script to check role of the 
given host only
......................................................................


labstore: Update check_drbd_role script to check role of the given host only

Change-Id: I097243c347b629b060232015bf50fa6abaadf0a8
---
M modules/labstore/files/monitor/check_drbd_role
1 file changed, 3 insertions(+), 4 deletions(-)

Approvals:
  Madhuvishy: Verified; Looks good to me, approved



diff --git a/modules/labstore/files/monitor/check_drbd_role 
b/modules/labstore/files/monitor/check_drbd_role
index e8ec4c8..27eb27d 100644
--- a/modules/labstore/files/monitor/check_drbd_role
+++ b/modules/labstore/files/monitor/check_drbd_role
@@ -14,10 +14,9 @@
     drbd_res_roles = str(
         subprocess.check_output(['/sbin/drbdadm', 'role', 'all']), 'utf-8')\
         .rstrip('\n').split('\n')
-    if expected_role == 'primary':
-        role_ok = all([role == 'Primary/Secondary' for role in drbd_res_roles])
-    else:
-        role_ok = all([role == 'Secondary/Primary' for role in drbd_res_roles])
+
+    role_ok = all([role.split('/')[0].lower() == expected_role.lower()
+                  for role in drbd_res_roles])
 
     if not role_ok:
         print('{}: Unexpected role match, expected role {}'.format(

-- 
To view, visit https://gerrit.wikimedia.org/r/320813
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I097243c347b629b060232015bf50fa6abaadf0a8
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Madhuvishy <[email protected]>
Gerrit-Reviewer: Madhuvishy <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to