Skip to content

Commit 24f45dd

Browse files
committed
High: Admin: All tools now use --node (-N) for specifying node unames
Mercurial revision: 1a2b853222a2a5ba71d8e6ef682a0106491f99e1
1 parent f552ea1 commit 24f45dd

File tree

4 files changed

+26
-24
lines changed

4 files changed

+26
-24
lines changed

crm/admin/cibadmin.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ int operation_status = 0;
8787
cib_t *the_cib = NULL;
8888

8989
gboolean force_flag = FALSE;
90-
#define OPTARGS "V?o:QDUCEX:t:Srwlsh:MmBfbRx:pP5"
90+
#define OPTARGS "V?o:QDUCEX:t:Srwlsh:MmBfbRx:pP5N:"
9191

9292

9393
int
@@ -128,7 +128,8 @@ main(int argc, char **argv)
128128
{"local", 0, 0, 'l'},
129129
{"sync-call", 0, 0, 's'},
130130
{"no-bcast", 0, 0, 'b'},
131-
{"host", 0, 0, 'h'},
131+
{"host", 0, 0, 'h'}, /* legacy */
132+
{"node", 0, 0, 'N'},
132133
{F_CRM_DATA, 1, 0, 'X'},
133134
{"xml-file", 1, 0, 'x'},
134135
{"xml-pipe", 0, 0, 'p'},

crm/admin/crm_attribute.c

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ const char *rsc_id = NULL;
6262
const char *dest_uname = NULL;
6363
const char *attr_value = NULL;
6464

65-
#define OPTARGS "V?GDQU:u:s:n:v:l:t:i:!r:"
65+
#define OPTARGS "V?GDQN:U:u:s:n:v:l:t:i:!r:"
6666

6767
int
6868
main(int argc, char **argv)
@@ -84,8 +84,9 @@ main(int argc, char **argv)
8484
{"quiet", 0, 0, 'Q'},
8585
{"get-value", 0, 0, 'G'},
8686
{"delete-attr", 0, 0, 'D'},
87-
{"node-uname", 1, 0, 'U'},
88-
{"node-uuid", 1, 0, 'u'},
87+
{"node", 1, 0, 'N'},
88+
{"node-uname", 1, 0, 'U'}, /* legacy */
89+
{"node-uuid", 1, 0, 'u'}, /* legacy */
8990
{"set-name", 1, 0, 's'},
9091
{"attr-id", 1, 0, 'i'},
9192
{"attr-name", 1, 0, 'n'},
@@ -133,6 +134,7 @@ main(int argc, char **argv)
133134
DO_DELETE = TRUE;
134135
break;
135136
case 'U':
137+
case 'N':
136138
crm_debug_2("Option %c => %s", flag, optarg);
137139
dest_uname = optarg;
138140
break;
@@ -447,21 +449,17 @@ usage(const char *cmd, int exit_status)
447449
"lifetime", 'l');
448450
exit(exit_status);
449451
} else if(safe_str_eq(cmd, "crm_standby")) {
450-
fprintf(stream, "\t--%s (-%c) <node_uuid>\t: "
451-
"UUID of the node to change\n", "node-uuid", 'u');
452452
fprintf(stream, "\t--%s (-%c) <node_uname>\t: "
453-
"uname of the node to change\n", "node-uname", 'U');
453+
"uname of the node to change\n", "node", 'N');
454454
fprintf(stream, "\t--%s (-%c) <string>\t: "
455455
"How long the preference lasts (reboot|forever)\n"
456456
"\t If a forever value exists, it is ALWAYS used by the CRM\n"
457457
"\t instead of any reboot value\n", "lifetime", 'l');
458458
exit(exit_status);
459459
}
460460

461-
fprintf(stream, "\t--%s (-%c) <node_uuid>\t: "
462-
"UUID of the node to change\n", "node-uuid", 'u');
463461
fprintf(stream, "\t--%s (-%c) <node_uname>\t: "
464-
"uname of the node to change\n", "node-uname", 'U');
462+
"uname of the node to change\n", "node-uname", 'h');
465463

466464
if(safe_str_eq(cmd, "crm_failcount")) {
467465
fprintf(stream, "\t--%s (-%c) <resource name>\t: "
@@ -476,9 +474,9 @@ usage(const char *cmd, int exit_status)
476474
"Which section of the CIB to set the attribute: (%s|%s|%s)\n",
477475
"type", 't',
478476
XML_CIB_TAG_NODES, XML_CIB_TAG_STATUS, XML_CIB_TAG_CRMCONFIG);
479-
fprintf(stream, "\t -t=%s options: -(U|u) -n [-s]\n", XML_CIB_TAG_NODES);
480-
fprintf(stream, "\t -t=%s options: -(U|u) -n [-s]\n", XML_CIB_TAG_STATUS);
481-
fprintf(stream, "\t -t=%s options: -n [-s]\n", XML_CIB_TAG_CRMCONFIG);
477+
fprintf(stream, "\t -t=%s options: -N -n [-s]\n", XML_CIB_TAG_NODES);
478+
fprintf(stream, "\t -t=%s options: -N -n [-s]\n", XML_CIB_TAG_STATUS);
479+
fprintf(stream, "\t -t=%s options: -N [-s]\n", XML_CIB_TAG_CRMCONFIG);
482480
}
483481

484482
if(safe_str_neq(crm_system_name, "crm_standby")) {

crm/admin/crm_resource.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ IPC_Channel *crmd_channel = NULL;
6767
char *xml_file = NULL;
6868
int cib_options = cib_sync_call;
6969

70-
#define OPTARGS "V?LRQxDCPp:WMUr:H:v:t:p:g:d:i:s:G:S:fX:lmu:FOoc"
70+
#define OPTARGS "V?LRQxDCPp:WMUr:H:h:v:t:p:g:d:i:s:G:S:fX:lmu:FOoc"
7171
#define CMD_ERR(fmt, args...) do { \
7272
crm_warn(fmt, ##args); \
7373
fprintf(stderr, fmt, ##args); \
@@ -881,7 +881,8 @@ main(int argc, char **argv)
881881
{"migrate", 0, 0, 'M'},
882882
{"un-migrate", 0, 0, 'U'},
883883
{"resource", 1, 0, 'r'},
884-
{"host-uname", 1, 0, 'H'},
884+
{"host-uname", 1, 0, 'H'}, /* legacy */
885+
{"node", 1, 0, 'N'},
885886
{"lifetime", 1, 0, 'u'},
886887
{"fail", 0, 0, 'F'},
887888
{"force", 0, 0, 'f'},
@@ -1018,6 +1019,7 @@ main(int argc, char **argv)
10181019
rsc_type = optarg;
10191020
break;
10201021

1022+
case 'h':
10211023
case 'H':
10221024
crm_debug_2("Option %c => %s", flag, optarg);
10231025
host_uname = optarg;
@@ -1432,7 +1434,7 @@ usage(const char *cmd, int exit_status)
14321434
"\t\t\t Optional: -H, -r\n", "list-operations", 'O');
14331435
fprintf(stream, "\t--%s (-%c) <string>: "
14341436
"List all resource operations. Optionally filtered by resource and/or node.\n"
1435-
"\t\t\t Optional: -H, -r\n", "list-all-operations", 'o');
1437+
"\t\t\t Optional: -N, -r\n", "list-all-operations", 'o');
14361438
fprintf(stream, "\nOptions\n");
14371439
fprintf(stream, "\t--%s (-%c) <string>\t: Resource ID\n", "resource", 'r');
14381440
fprintf(stream, "\t--%s (-%c) <string>\t: "
@@ -1441,8 +1443,7 @@ usage(const char *cmd, int exit_status)
14411443

14421444
fprintf(stream, "\t--%s (-%c) <string>\t: "
14431445
"Property value\n", "property-value", 'v');
1444-
fprintf(stream, "\t--%s (-%c) <string>\t: "
1445-
"Host name\n", "host-uname", 'H');
1446+
fprintf(stream, "\t--%s (-%c) <string>\t: Host uname\n", "node", 'N');
14461447
fprintf(stream, "\t--%s\t: Modify a resource's configuration option rather than one which is passed to the resource agent script."
14471448
"\n\t\tFor use with -p, -g, -d\n", "meta");
14481449
fprintf(stream, "\t--%s (-%c) <string>\t: "

tools/pingd.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ void do_node_walk(ll_cluster_t *hb_cluster);
7575
#endif
7676

7777
/* GMainLoop *mainloop = NULL; */
78-
#define OPTARGS "V?p:a:d:s:S:h:Dm:"
78+
#define OPTARGS "V?p:a:d:s:S:h:Dm:N:"
7979

8080
GListPtr ping_list = NULL;
8181
IPC_Channel *attrd = NULL;
@@ -501,7 +501,7 @@ usage(const char *cmd, int exit_status)
501501
"\t\t\t\t\t* Default=cib-bootstrap-options\n", "attr-set", 's');
502502
fprintf(stream, "\t--%s (-%c) <string>\tWhich part of the CIB to put the attribute in\n"
503503
"\t\t\t\t\t* Default=status\n", "attr-section", 'S');
504-
fprintf(stream, "\t--%s (-%c) <single_host_name>\tMonitor a subset of the ping nodes listed in ha.cf (can be specified multiple times)\n", "ping-host", 'h');
504+
fprintf(stream, "\t--%s (-%c) <single_host_name>\tMonitor a subset of the ping nodes listed in ha.cf (can be specified multiple times)\n", "node", 'N');
505505
fprintf(stream, "\t--%s (-%c) <integer>\t\tHow long to wait for no further changes to occur before updating the CIB with a changed attribute\n", "attr-dampen", 'd');
506506
fprintf(stream, "\t--%s (-%c) <integer>\tFor every connected node, add <integer> to the value set in the CIB\n"
507507
"\t\t\t\t\t\t* Default=1\n", "value-multiplier", 'm');
@@ -705,10 +705,11 @@ main(int argc, char **argv)
705705
int option_index = 0;
706706
static struct option long_options[] = {
707707
/* Top-level Options */
708-
{"verbose", 0, 0, 'V'},
709-
{"help", 0, 0, '?'},
708+
{"verbose", 0, 0, 'V'},
709+
{"help", 0, 0, '?'},
710710
{"pid-file", 1, 0, 'p'},
711-
{"ping-host", 1, 0, 'h'},
711+
{"node", 1, 0, 'N'},
712+
{"ping-host", 1, 0, 'h'}, /* legacy */
712713
{"attr-name", 1, 0, 'a'},
713714
{"attr-set", 1, 0, 's'},
714715
{"daemonize", 0, 0, 'D'},
@@ -751,6 +752,7 @@ main(int argc, char **argv)
751752
case 'a':
752753
pingd_attr = crm_strdup(optarg);
753754
break;
755+
case 'N':
754756
case 'h':
755757
stand_alone = TRUE;
756758
crm_debug("Adding ping host %s", optarg);

0 commit comments

Comments
 (0)