1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-02 09:47:23 +03:00

ctdb-tools: Drop support for setting and viewing NAT gateway capability

This is no longer used.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
Martin Schwenke 2016-01-05 15:58:29 +11:00 committed by Amitay Isaacs
parent 3b64c27ca6
commit df6cca2bc0
8 changed files with 7 additions and 74 deletions

View File

@ -769,7 +769,6 @@ MaxRedirectCount = 3
RECMASTER: YES
LMASTER: YES
LVS: NO
NATGW: YES
</screen>
</refsect2>
@ -1404,13 +1403,6 @@ RUNNING
</para>
</refsect2>
<refsect2>
<title>setnatgwstate on|off</title>
<para>
Enable or disable the NAT gateway master capability on a node.
</para>
</refsect2>
<refsect2>
<title>tickle <parameter>SRC-IPADDR</parameter>:<parameter>SRC-PORT</parameter> <parameter>DST-IPADDR</parameter>:<parameter>DST-PORT</parameter></title>
<para>

View File

@ -446,18 +446,6 @@ Node 3:/usr/local/etc/ctdb/public_addresses
</listitem>
</varlistentry>
<varlistentry>
<term>NATGW</term>
<listitem>
<para>
Indicates that this node is configured to become the NAT
gateway master in a NAT gateway group. See the
<citetitle>NAT GATEWAY</citetitle> section for more
details.
</para>
</listitem>
</varlistentry>
</variablelist>
<para>

View File

@ -243,13 +243,6 @@ ctdb_shutdown ()
######################################################################
FAKE_CTDB_NATGW_STATE="${FAKE_CTDB_STATE}/natgw_state"
ctdb_setnatgwstate ()
{
echo "$2" >"$FAKE_CTDB_NATGW_STATE"
}
# This is only used by the NAT gateway code at the moment, so use a
# hack. Assume that $CTDB_NATGW_NODES contains all nodes in the
# cluster (which is what current tests assume). Use the PNN to find
@ -468,7 +461,6 @@ case "$1" in
disable) ctdb_disable "$@";;
moveip) ctdb_moveip "$@";;
shutdown) ctdb_shutdown "$@";;
setnatgwstate) ctdb_setnatgwstate "$@" ;;
setvar) ctdb_setvar "$@" ;;
nodestatus) ctdb_nodestatus "$@" ;;
*) not_implemented "$1" ;;

View File

@ -27,7 +27,7 @@ static struct ctdb_node_capabilities *global_caps = NULL;
* EOF or a blank line terminates input.
*
* By default, capablities for each node are
* CTDB_CAP_RECMASTER|CTDB_CAP_LMASTER|CTDB_CAP_NATGW. These 3
* CTDB_CAP_RECMASTER|CTDB_CAP_LMASTER. These 2
* capabilities can be faked off by adding, for example,
* -CTDB_CAP_RECMASTER. LVS can be faked on by adding
* CTDB_CAP_LVS.
@ -90,7 +90,7 @@ static void ctdb_test_stubs_read_nodemap(struct ctdb_context *ctdb)
talloc_free(ip);
ip = talloc_strdup(ctdb, "0.0.0.0");
}
capabilities = CTDB_CAP_RECMASTER|CTDB_CAP_LMASTER|CTDB_CAP_NATGW;
capabilities = CTDB_CAP_RECMASTER|CTDB_CAP_LMASTER;
tok = strtok(NULL, " \t");
while (tok != NULL) {
@ -102,8 +102,6 @@ static void ctdb_test_stubs_read_nodemap(struct ctdb_context *ctdb)
capabilities &= ~CTDB_CAP_RECMASTER;
} else if (strcmp(tok, "-CTDB_CAP_LMASTER") == 0) {
capabilities &= ~CTDB_CAP_LMASTER;
} else if (strcmp(tok, "-CTDB_CAP_NATGW") == 0) {
capabilities &= ~CTDB_CAP_NATGW;
} else if (strcmp(tok, "CTDB_CAP_LVS") == 0) {
capabilities |= CTDB_CAP_LVS;
} else if (strcmp(tok, "TIMEOUT") == 0) {

View File

@ -8,7 +8,6 @@ required_result 0 <<EOF
RECMASTER: YES
LMASTER: YES
LVS: NO
NATGW: YES
EOF
simple_test <<EOF

View File

@ -8,7 +8,6 @@ required_result 0 <<EOF
RECMASTER: YES
LMASTER: YES
LVS: NO
NATGW: YES
EOF
simple_test <<EOF

View File

@ -10,7 +10,7 @@ input="\
NODEMAP
0 192.168.20.41 0x0 CURRENT RECMASTER CTDB_CAP_LVS
1 192.168.20.42 0x0 -CTDB_CAP_LMASTER
2 192.168.20.43 0x0 -CTDB_CAP_RECMASTER -CTDB_CAP_NATGW
2 192.168.20.43 0x0 -CTDB_CAP_RECMASTER
IFACES
:Name:LinkStatus:References:
@ -27,7 +27,6 @@ required_result 0 <<EOF
RECMASTER: YES
LMASTER: YES
LVS: YES
NATGW: YES
EOF
simple_test -n 0 <<EOF
@ -38,7 +37,6 @@ required_result 0 <<EOF
RECMASTER: YES
LMASTER: NO
LVS: NO
NATGW: YES
EOF
simple_test -n 1 <<EOF
@ -49,7 +47,6 @@ required_result 0 <<EOF
RECMASTER: NO
LMASTER: YES
LVS: NO
NATGW: NO
EOF
simple_test -n 2 <<EOF

View File

@ -3433,19 +3433,17 @@ static int control_getcapabilities(struct ctdb_context *ctdb, int argc, const ch
DEBUG(DEBUG_ERR, ("Unable to get capabilities from node %u\n", options.pnn));
return -1;
}
if (!options.machinereadable){
printf("RECMASTER: %s\n", (capabilities&CTDB_CAP_RECMASTER)?"YES":"NO");
printf("LMASTER: %s\n", (capabilities&CTDB_CAP_LMASTER)?"YES":"NO");
printf("LVS: %s\n", (capabilities&CTDB_CAP_LVS)?"YES":"NO");
printf("NATGW: %s\n", (capabilities&CTDB_CAP_NATGW)?"YES":"NO");
} else {
printm(":RECMASTER:LMASTER:LVS:NATGW:\n");
printm(":%d:%d:%d:%d:\n",
printm(":RECMASTER:LMASTER:LVS:\n");
printm(":%d:%d:%d:\n",
!!(capabilities&CTDB_CAP_RECMASTER),
!!(capabilities&CTDB_CAP_LMASTER),
!!(capabilities&CTDB_CAP_LVS),
!!(capabilities&CTDB_CAP_NATGW));
!!(capabilities&CTDB_CAP_LVS));
}
return 0;
}
@ -4804,35 +4802,6 @@ static int control_setreclock(struct ctdb_context *ctdb, int argc, const char **
return 0;
}
/*
set the natgw state on/off
*/
static int control_setnatgwstate(struct ctdb_context *ctdb, int argc, const char **argv)
{
int ret;
uint32_t natgwstate = 0;
if (argc == 0) {
usage();
}
if (!strcmp(argv[0], "on")) {
natgwstate = 1;
} else if (!strcmp(argv[0], "off")) {
natgwstate = 0;
} else {
usage();
}
ret = ctdb_ctrl_setnatgwstate(ctdb, TIMELIMIT(), options.pnn, natgwstate);
if (ret != 0) {
DEBUG(DEBUG_ERR, ("Unable to set the natgw state for node %u\n", options.pnn));
return ret;
}
return 0;
}
/*
set the lmaster role on/off
*/
@ -6414,7 +6383,6 @@ static const struct {
{ "xpnn", control_xpnn, false, true, "find the pnn of the local node without talking to the daemon (unreliable)" },
{ "getreclock", control_getreclock, true, false, "Show the reclock file of a node"},
{ "setreclock", control_setreclock, true, false, "Set/clear the reclock file of a node", "[filename]"},
{ "setnatgwstate", control_setnatgwstate, false, false, "Set NATGW state to on/off", "{on|off}"},
{ "setlmasterrole", control_setlmasterrole, false, false, "Set LMASTER role to on/off", "{on|off}"},
{ "setrecmasterrole", control_setrecmasterrole, false, false, "Set RECMASTER role to on/off", "{on|off}"},
{ "setdbprio", control_setdbprio, false, false, "Set DB priority", "<dbname|dbid> <prio:1-3>"},