pacemaker/pacemaker-ptest-xml-text.diff
Tim Serong 527a76dc73 - Core: Move several new fields since v1.1.6 to the end of the data
types for ABI compliance 
- stonith: Default to 20s timeout for start and monitor operations of
  stonith resources which is same as "default-action-timeout" (bnc#733337)
- Tools: ptest - Fix "-X, --xml-text" option to handle a XML string as its
  argument (bnc#736212)
- cib: Fix segfault caused by destroying an already freed hash table (cl#5023)
- stonith: Expose IDs of stonith resources to stonith agents through
  "$CRM_meta_st_device_id" environment variable (bnc#728579)

OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/pacemaker?expand=0&rev=31
2012-02-14 03:25:00 +00:00

39 lines
1.2 KiB
Diff

commit 581af7d3061a3ff680e0a15351099df255cf6b03
Author: Gao,Yan <ygao@suse.com>
Date: Mon Dec 19 14:39:03 2011 +0800
Medium: Tools: ptest - Fix "-X, --xml-text" option to handle a XML string as its argument
diff --git a/pengine/ptest.c b/pengine/ptest.c
index 6372a72..545f695 100644
--- a/pengine/ptest.c
+++ b/pengine/ptest.c
@@ -167,6 +167,7 @@ main(int argc, char **argv)
const char *dot_file = NULL;
const char *graph_file = NULL;
const char *input_file = NULL;
+ const char *input_xml = NULL;
/* disable glib's fancy allocators that can't be free'd */
GMemVTable vtable;
@@ -203,7 +204,8 @@ main(int argc, char **argv)
inhibit_exit = TRUE;
break;
case 'X':
- use_stdin = TRUE;
+ /*use_stdin = TRUE;*/
+ input_xml = optarg;
break;
case 's':
show_scores = TRUE;
@@ -290,6 +292,9 @@ main(int argc, char **argv)
} else if (use_stdin) {
source = "stdin";
cib_object = filename2xml(NULL);
+ } else if (input_xml) {
+ source = "input string";
+ cib_object = string2xml(input_xml);
}
if (cib_object == NULL && source) {