2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-25 19:10:10 +00:00

Change detach to detachall

It is more clear what detach will do this way.  Also block more
attempts.
This commit is contained in:
Jarrod Johnson 2018-01-22 15:56:59 -05:00
parent 9b7db2a924
commit 98a763eb35
2 changed files with 10 additions and 5 deletions

View File

@ -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 <noderange> [list|upload|attach|detach] "
usage="Usage: %prog <noderange> [list|upload|attach|detachall] "
"<filename>|all|<url>",
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)

View File

@ -3,7 +3,7 @@ nodemedia(8) -- Manage server remote media
## SYNOPSIS
`nodemedia <noderange> [attach|detach|list|upload] <media>`
`nodemedia <noderange> [attach|detachall|list|upload] <media>`
## 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