Skip to content

Commit

Permalink
cmd/flux-version: show libflux-security version
Browse files Browse the repository at this point in the history
If flux-core is compiled --with-flux-security, include
the output of flux_security_version_string() in the
flux-version output.

Make this conditional on the definition of the cpp symbol
FLUX_SECURITY_VERSION_STRING, so that in the short term,
flux-core works with older versions of flux-security that
don't define flux_security_version_string().
  • Loading branch information
garlick committed Nov 11, 2018
1 parent af22e68 commit c86d7aa
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/cmd/builtin/version.c
Expand Up @@ -25,6 +25,9 @@
#include <config.h>

#include "builtin.h"
#if HAVE_FLUX_SECURITY
#include <flux/security/version.h>
#endif


static void print_broker_version (optparse_t *p)
Expand All @@ -39,14 +42,17 @@ static void print_broker_version (optparse_t *p)
log_err_exit ("flux_open %s failed", uri);
if (!(version = flux_attr_get (h, "version", NULL)))
log_err_exit ("flux_attr_get");
printf ("broker: \t%s\n", version);
printf ("FLUX_URI:\t%s\n", uri);
printf ("broker: \t\t%s\n", version);
printf ("FLUX_URI:\t\t%s\n", uri);
}

static int cmd_version (optparse_t *p, int ac, char *av[])
{
printf ("commands: \t%s\n", FLUX_CORE_VERSION_STRING);
printf ("libflux-core:\t%s\n", flux_core_version_string ());
printf ("commands: \t\t%s\n", FLUX_CORE_VERSION_STRING);
printf ("libflux-core:\t\t%s\n", flux_core_version_string ());
#ifdef FLUX_SECURITY_VERSION_STRING
printf ("libflux-security:\t%s\n", flux_security_version_string ());
#endif
print_broker_version (p);

return (0);
Expand Down

0 comments on commit c86d7aa

Please sign in to comment.