Skip to content

Commit fdbd606

Browse files
committed
flux-admin: drop unused command
Problem: flux admin cleanup-push is no longer needed. Drop the flux-admin command (that was the only subcommand). Drop bash completion. Drop the broker runat.push RPC. Update the flux(1) help output test.
1 parent bd14088 commit fdbd606

File tree

5 files changed

+0
-143
lines changed

5 files changed

+0
-143
lines changed

etc/completions/flux.pre

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -883,25 +883,6 @@ _flux_config()
883883
return 0
884884
}
885885

886-
# flux-admin(8) completions
887-
_flux_admin()
888-
{
889-
local cmd=$1
890-
local subcmds="cleanup-push"
891-
892-
if [[ $cmd != "admin" ]]; then
893-
var="${cmd//-/_}_OPTS"
894-
COMPREPLY=( $(compgen -W "${!var} -h --help" -- "$cur") )
895-
if [[ "${COMPREPLY[@]}" == *= ]]; then
896-
# Add space if there is not a '=' in suggestions
897-
compopt -o nospace
898-
fi
899-
else
900-
COMPREPLY=( $(compgen -W "${subcmds}" -- "$cur") )
901-
fi
902-
return 0
903-
}
904-
905886
# flux-module(1) completions
906887
_flux_module()
907888
{

src/broker/runat.c

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ struct runat {
6565
flux_t *h;
6666
const char *local_uri;
6767
zhashx_t *entries;
68-
flux_msg_handler_t **handlers;
6968
bool sd_notify;
7069
struct termios saved_termios;
7170
};
@@ -637,58 +636,6 @@ int runat_abort (struct runat *r, const char *name)
637636
return 0;
638637
}
639638

640-
static void runat_push_cb (flux_t *h,
641-
flux_msg_handler_t *mh,
642-
const flux_msg_t *msg,
643-
void *arg)
644-
{
645-
struct runat *r = arg;
646-
const char *name;
647-
json_t *commands;
648-
const char *errstr = NULL;
649-
size_t index;
650-
json_t *el;
651-
652-
if (flux_request_unpack (msg,
653-
NULL,
654-
"{s:s s:o}",
655-
"name",
656-
&name,
657-
"commands",
658-
&commands) < 0)
659-
goto error;
660-
if (json_array_size (commands) == 0) {
661-
errno = EPROTO;
662-
errstr = "commands array is empty";
663-
goto error;
664-
}
665-
json_array_foreach (commands, index, el) {
666-
const char *cmdline = json_string_value (el);
667-
if (!cmdline || strlen (cmdline) == 0) {
668-
errno = EPROTO;
669-
errstr = "cannot push an empty command line";
670-
goto error;
671-
}
672-
if (runat_push_shell_command (r,
673-
name,
674-
cmdline,
675-
RUNAT_FLAG_LOG_STDIO) < 0)
676-
goto error;
677-
}
678-
if (flux_respond (h, msg, NULL) < 0)
679-
flux_log (h, LOG_ERR, "error responding to runat.push");
680-
return;
681-
error:
682-
if (flux_respond_error (h, msg, errno, errstr) < 0)
683-
flux_log (h, LOG_ERR, "error responding to runat.push");
684-
}
685-
686-
687-
static const struct flux_msg_handler_spec htab[] = {
688-
{ FLUX_MSGTYPE_REQUEST, "runat.push", runat_push_cb, 0 },
689-
FLUX_MSGHANDLER_TABLE_END,
690-
};
691-
692639
struct runat *runat_create (flux_t *h, const char *local_uri, bool sdnotify)
693640
{
694641
struct runat *r;
@@ -697,8 +644,6 @@ struct runat *runat_create (flux_t *h, const char *local_uri, bool sdnotify)
697644
return NULL;
698645
if (!(r->entries = zhashx_new ()))
699646
goto error;
700-
if (flux_msg_handler_addvec (h, htab, r, &r->handlers) < 0)
701-
goto error;
702647
zhashx_set_destructor (r->entries, runat_entry_destroy_wrapper);
703648
r->h = h;
704649
r->local_uri = local_uri;
@@ -717,7 +662,6 @@ void runat_destroy (struct runat *r)
717662
if (r) {
718663
int saved_errno = errno;
719664
zhashx_destroy (&r->entries);
720-
flux_msg_handler_delvec (r->handlers);
721665
free (r);
722666
errno = saved_errno;
723667
}

src/cmd/Makefile.am

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ dist_fluxcmd_SCRIPTS = \
105105
flux-jobs.py \
106106
flux-fortune.py \
107107
flux-resource.py \
108-
flux-admin.py \
109108
flux-jobtap.py \
110109
flux-job-validator.py \
111110
flux-job-frobnicator.py \

src/cmd/flux-admin.py

Lines changed: 0 additions & 66 deletions
This file was deleted.

t/t0001-basic.t

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,6 @@ test_expect_success 'no unit tests built with libtool wrapper' '
818818

819819
CMDS="\
820820
R \
821-
admin \
822821
cron \
823822
event \
824823
exec \

0 commit comments

Comments
 (0)