File Fix-parsing-drbdsetup-show-for-adjust.patch of Package drbd-utils.5899

commit a40a5a5f359e32ed276d4fec1919aabaa354dc38
Author: Philipp Reisner <philipp.reisner@linbit.com>
Date:   Tue Oct 10 14:51:37 2017 +0200

    drbdadm: fix parsing drbdsetup show for adjust
    
    With commit 39380e534739 the check became so strict that it failed to
    parse the drbdsetup show output. Relax it just for that purpose.

diff -Naur drbd-utils-9.0.0.orig/user/v9/drbdadm_postparse.c drbd-utils-9.0.0/user/v9/drbdadm_postparse.c
--- drbd-utils-9.0.0.orig/user/v9/drbdadm_postparse.c	2018-01-18 11:25:01.832584479 +0800
+++ drbd-utils-9.0.0/user/v9/drbdadm_postparse.c	2018-01-18 11:25:09.520544557 +0800
@@ -1042,12 +1042,14 @@
 		STAILQ_FOREACH(peer_device, &conn->peer_devices, connection_link) {
 			STAILQ_FOREACH(ha, &some_path->hname_address_pairs, link) {
 				struct d_host_info *host = ha->host_info;
+				if (!strcmp("_remote_host", ha->name)) /* && PARSE_FOR_ADJUST */
+					continue; /* no on section for _remote_host in show output! */
 				vol = volume_by_vnr(&host->volumes, peer_device->vnr);
 				if (!vol) {
-					err("%s:%d: Resource %s: There is a reference to a volume %d that"
-					    "is not known in this resource\n",
+					err("%s:%d: Resource %s: There is a reference to a volume %d that "
+					    "is not known in this resource on host %s\n",
 					    res->config_file, peer_device->config_line, res->name,
-					    peer_device->vnr);
+					    peer_device->vnr, ha->name);
 					config_valid = 0;
 				}
 			}
openSUSE Build Service is sponsored by