From 98a763eb350691b92696b8f0c2976e022ed08687 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Mon, 22 Jan 2018 15:56:59 -0500 Subject: [PATCH] Change detach to detachall It is more clear what detach will do this way. Also block more attempts. --- confluent_client/bin/nodemedia | 11 ++++++++--- confluent_client/doc/man/nodemedia.ronn | 4 ++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/confluent_client/bin/nodemedia b/confluent_client/bin/nodemedia index 69e2bde0..57a3f67d 100644 --- a/confluent_client/bin/nodemedia +++ b/confluent_client/bin/nodemedia @@ -130,18 +130,18 @@ def upload_media(noderange, media): funmap = { 'upload': upload_media, 'attach': attach_media, - 'detach': detach_media, + 'detachall': detach_media, 'list': list_media, } def main(): argparser = optparse.OptionParser( - usage="Usage: %prog [list|upload|attach|detach] " + usage="Usage: %prog [list|upload|attach|detachall] " "|all|", epilog='upload will take the specified file and upload it to the BMC, ' 'attach will instruct the BMC to connect a remote media to the ' - 'specified url, and detach will remove all uploaded and' + 'specified url, and detachall will remove all uploaded and' 'attached urls from the BMC, list shows currently mounted ' 'media.') (options, args) = argparser.parse_args() @@ -149,8 +149,13 @@ def main(): try: noderange = args[0] operation = args[1] + arglength = 2 if operation in ('attach', 'upload'): media = args[2] + arglength = 3 + if len(args) > arglength: + argparser.print_help() + sys.exit(1) except IndexError: argparser.print_help() sys.exit(1) diff --git a/confluent_client/doc/man/nodemedia.ronn b/confluent_client/doc/man/nodemedia.ronn index c553a62d..988055a2 100644 --- a/confluent_client/doc/man/nodemedia.ronn +++ b/confluent_client/doc/man/nodemedia.ronn @@ -3,7 +3,7 @@ nodemedia(8) -- Manage server remote media ## SYNOPSIS -`nodemedia [attach|detach|list|upload] ` +`nodemedia [attach|detachall|list|upload] ` ## DESCRIPTION @@ -12,7 +12,7 @@ nodemedia(8) -- Manage server remote media `list` shows all the current remote media the BMCs of the noderange are providing to the host platform. -`detach` removes all the currently provided media to the host. This unlinks +`detachall` removes all the currently provided media to the host. This unlinks remote media from urls and deletes uploaded media from the BMC. `upload` takes the given media image and uploads it to the BMC. This causes