|
|
1f016a |
commit 7652cce56196ee039245c21f8a7f8d5e55149358
|
|
|
1f016a |
Author: Andrew Beekhof <andrew@beekhof.net>
|
|
|
1f016a |
Date: Wed Jan 14 12:05:38 2015 +1100
|
|
|
1f016a |
|
|
|
1f016a |
Feature: attrd_updater: Allow attributes to be set for other nodes
|
|
|
1f016a |
|
|
|
1f016a |
diff --git a/tools/attrd_updater.c b/tools/attrd_updater.c
|
|
|
1f016a |
index 54b2c60..703f7f9 100644
|
|
|
1f016a |
--- a/tools/attrd_updater.c
|
|
|
1f016a |
+++ b/tools/attrd_updater.c
|
|
|
1f016a |
@@ -32,6 +32,7 @@
|
|
|
1f016a |
|
|
|
1f016a |
#include <crm/attrd.h>
|
|
|
1f016a |
|
|
|
1f016a |
+const char *attr_node = NULL;
|
|
|
1f016a |
const char *attr_name = NULL;
|
|
|
1f016a |
const char *attr_value = NULL;
|
|
|
1f016a |
const char *attr_set = NULL;
|
|
|
1f016a |
@@ -59,6 +60,7 @@ static struct crm_option long_options[] = {
|
|
|
1f016a |
{"lifetime",1, 0, 'l', "Lifetime of the node attribute. Allowed values: forever, reboot"},
|
|
|
1f016a |
{"delay", 1, 0, 'd', "The time to wait (dampening) in seconds further changes occur"},
|
|
|
1f016a |
{"set", 1, 0, 's', "(Advanced) The attribute set in which to place the value"},
|
|
|
1f016a |
+ {"node", 1, 0, 'N', "Set the attribute for the named node (instead of the local one)"},
|
|
|
1f016a |
|
|
|
1f016a |
/* Legacy options */
|
|
|
1f016a |
{"update", 1, 0, 'v', NULL, 1},
|
|
|
1f016a |
@@ -108,6 +110,9 @@ main(int argc, char **argv)
|
|
|
1f016a |
case 'S':
|
|
|
1f016a |
attr_section = strdup(optarg);
|
|
|
1f016a |
break;
|
|
|
1f016a |
+ case 'N':
|
|
|
1f016a |
+ attr_node = strdup(optarg);
|
|
|
1f016a |
+ break;
|
|
|
1f016a |
case 'q':
|
|
|
1f016a |
break;
|
|
|
1f016a |
case 'Q':
|
|
|
1f016a |
@@ -141,7 +146,7 @@ main(int argc, char **argv)
|
|
|
1f016a |
crm_help('?', EX_USAGE);
|
|
|
1f016a |
|
|
|
1f016a |
} else {
|
|
|
1f016a |
- int rc = attrd_update_delegate(NULL, command, NULL, attr_name, attr_value, attr_section,
|
|
|
1f016a |
+ int rc = attrd_update_delegate(NULL, command, attr_node, attr_name, attr_value, attr_section,
|
|
|
1f016a |
attr_set, attr_dampen, NULL, FALSE);
|
|
|
1f016a |
if (rc != pcmk_ok) {
|
|
|
1f016a |
fprintf(stderr, "Could not update %s=%s: %s (%d)\n", attr_name, attr_value, pcmk_strerror(rc), rc);
|