Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 4 commits
  • 5 files changed
  • 0 comments
  • 1 contributor
5  crmd/lrm.c
@@ -418,6 +418,7 @@ lrm_state_verify_stopped(lrm_state_t * lrm_state, enum crmd_fsa_state cur_state,
418 418
 static char *
419 419
 get_rsc_metadata(const char *type, const char *class, const char *provider)
420 420
 {
  421
+    int rc = 0;
421 422
     char *metadata = NULL;
422 423
 
423 424
     /* Always use a local connection for this operation */
@@ -432,7 +433,7 @@ get_rsc_metadata(const char *type, const char *class, const char *provider)
432 433
     }
433 434
 
434 435
     crm_trace("Retreiving metadata for %s::%s:%s", type, class, provider);
435  
-    lrm_state_get_metadata(lrm_state, class, provider, type, &metadata, 0);
  436
+    rc = lrm_state_get_metadata(lrm_state, class, provider, type, &metadata, 0);
436 437
 
437 438
     if (metadata) {
438 439
         /* copy the metadata because the LRM likes using
@@ -444,7 +445,7 @@ get_rsc_metadata(const char *type, const char *class, const char *provider)
444 445
         metadata = m_copy;
445 446
 
446 447
     } else {
447  
-        crm_warn("No metadata found for %s::%s:%s", type, class, provider);
  448
+        crm_warn("No metadata found for %s::%s:%s: %s (%d)", type, class, provider, pcmk_strerror(rc), rc);
448 449
     }
449 450
 
450 451
     return metadata;
2  extra/cluster-clean
@@ -38,6 +38,8 @@ if [ $kill != 0 ]; then
38 38
     echo "Cleaning processes"
39 39
     cluster-helper $target -- "killall -q -9 corosync aisexec heartbeat pacemakerd pacemaker-remoted ccm stonithd ha_logd lrmd crmd pengine attrd pingd mgmtd cib fenced dlm_controld gfs_controld" &> /dev/null
40 40
 
  41
+    cluster-helper $target -- 'kill -q -9 `pidof valgrind`' &> /dev/null
  42
+
41 43
     # Bah. Force systemd to actually look at the process and realize its dead"
42 44
     cluster-helper $target -- "service corosync stop" &> /dev/null
43 45
     cluster-helper $target -- "service pacemaker stop" &> /dev/null
8  lib/common/xml.c
@@ -1065,8 +1065,8 @@ log_data_element(int log_level, const char *file, const char *function, int line
1065 1065
 
1066 1066
     /* Since we use the same file and line, to avoid confusing libqb, we need to use the same format strings */
1067 1067
     if (data == NULL) {
1068  
-        do_crm_log_alias(log_level, file, function, line, "%s%s", prefix,
1069  
-                         ": No data to dump as XML");
  1068
+        do_crm_log_alias(log_level, file, function, line, "%s: %s", prefix,
  1069
+                         "No data to dump as XML");
1070 1070
         return;
1071 1071
 
1072 1072
     } else if (is_set(options, xml_log_option_diff_short)
@@ -1128,7 +1128,7 @@ log_data_element(int log_level, const char *file, const char *function, int line
1128 1128
         buffer_print(buffer, max, offset, "/>");
1129 1129
     }
1130 1130
 
1131  
-    do_crm_log_alias(log_level, file, function, line, "%s%s", prefix, buffer);
  1131
+    do_crm_log_alias(log_level, file, function, line, "%s %s", prefix, buffer);
1132 1132
 
1133 1133
     if (data->children) {
1134 1134
         offset = 0;
@@ -1143,7 +1143,7 @@ log_data_element(int log_level, const char *file, const char *function, int line
1143 1143
         insert_prefix(options, &buffer, &offset, &max, depth);
1144 1144
         buffer_print(buffer, max, offset, "</%s>", name);
1145 1145
 
1146  
-        do_crm_log_alias(log_level, file, function, line, "%s%s", prefix, buffer);
  1146
+        do_crm_log_alias(log_level, file, function, line, "%s %s", prefix, buffer);
1147 1147
     }
1148 1148
 
1149 1149
     free(prefix_m);
11  lib/lrmd/lrmd_client.c
@@ -1555,11 +1555,15 @@ lsb_get_metadata(const char *type, char **output)
1555 1555
     char *xml_l_dscrpt = NULL;
1556 1556
     GString *l_dscrpt = NULL;
1557 1557
 
1558  
-    snprintf(ra_pathname, sizeof(ra_pathname), "%s%s%s",
1559  
-             type[0] == '/' ? "" : LSB_ROOT_DIR, type[0] == '/' ? "" : "/", type);
  1558
+    if(type[0] == '/') {
  1559
+        snprintf(ra_pathname, sizeof(ra_pathname), "%s", type);
  1560
+    } else {
  1561
+        snprintf(ra_pathname, sizeof(ra_pathname), "%s/%s", LSB_ROOT_DIR, type);
  1562
+    }
1560 1563
 
  1564
+    crm_trace("Looking into %s", ra_pathname);
1561 1565
     if (!(fp = fopen(ra_pathname, "r"))) {
1562  
-        return -EIO;
  1566
+        return -errno;
1563 1567
     }
1564 1568
 
1565 1569
     /* Enter into the lsb-compliant comment block */
@@ -1628,6 +1632,7 @@ lsb_get_metadata(const char *type, char **output)
1628 1632
     *output = strdup(meta_data->str);
1629 1633
     g_string_free(meta_data, TRUE);
1630 1634
 
  1635
+    crm_trace("Created fake metadata: %d", strlen(*output));
1631 1636
     return pcmk_ok;
1632 1637
 }
1633 1638
 
6  lrmd/regression.py.in
@@ -204,7 +204,7 @@ class Tests:
204 204
 		self.tests = []
205 205
 		self.verbose = verbose
206 206
 		self.tls = tls;
207  
-		self.rsc_classes = output_from_command("crm_resource --list-standards")		
  207
+		self.rsc_classes = output_from_command("crm_resource --list-standards")
208 208
 		self.rsc_classes = self.rsc_classes[:-1] # Strip trailing empty line
209 209
 		print "Testing "+repr(self.rsc_classes)
210 210
 
@@ -715,7 +715,7 @@ if __name__ == "__main__":
715 715
 			"-l \"NEW_EVENT event_type:exec_complete rsc_id:test_rsc action:start rc:ok op_status:complete\" ")
716 716
 		test.add_cmd("-c exec -r \"test_rsc\" -a \"monitor\" -i \"100\" -t 3000 -n "
717 717
 			"-l \"NEW_EVENT event_type:exec_complete rsc_id:test_rsc action:monitor rc:ok op_status:complete\" ")
718  
-		# this will fail because the monitor notifications should only go to the original caller, which no longer exists. 
  718
+		# this will fail because the monitor notifications should only go to the original caller, which no longer exists.
719 719
 		test.add_expected_fail_cmd("-l \"NEW_EVENT event_type:exec_complete rsc_id:test_rsc action:monitor rc:ok op_status:complete\" -t 3000")
720 720
 		test.add_cmd("-c cancel -r \"test_rsc\" -a \"monitor\" -i \"100\" -t \"3000\" ")
721 721
 		test.add_cmd("-c unregister_rsc -r \"test_rsc\" -t 3000 "
@@ -732,7 +732,7 @@ if __name__ == "__main__":
732 732
 		### get metadata ###
733 733
 		test = self.new_test("get_lsb_metadata", "Retrieve metadata for a resource")
734 734
 		test.add_cmd_check_stdout("-c metadata -C \"lsb\" -T \"lrmd_dummy_daemon\""
735  
-			,"resource-agent name=\"lrmd_dummy_daemon\"")
  735
+			,"resource-agent name='lrmd_dummy_daemon'")
736 736
 
737 737
 		### get stonith metadata ###
738 738
 		test = self.new_test("get_stonith_metadata", "Retrieve stonith metadata for a resource")

No commit comments for this range

Something went wrong with that request. Please try again.