mirror of
https://github.com/xcat2/confluent.git
synced 2024-12-25 12:41:39 +00:00
Fix nodemedia upload
Implement the tracking properly
This commit is contained in:
parent
3265d812ba
commit
9f5b88eb9f
@ -35,6 +35,19 @@ import confluent.screensqueeze as sq
|
||||
|
||||
exitcode = 0
|
||||
|
||||
|
||||
def get_update_progress(session, url):
|
||||
for res in session.read(url):
|
||||
status = res['phase']
|
||||
percent = res['progress']
|
||||
detail = res['detail']
|
||||
if status == 'error':
|
||||
text = 'error!'
|
||||
else:
|
||||
text = '{0}: {1:3.0f}%'.format(status, percent)
|
||||
return text, status, detail
|
||||
|
||||
|
||||
def printerror(res, node=None):
|
||||
global exitcode
|
||||
if 'errorcode' in res:
|
||||
@ -133,7 +146,7 @@ def main():
|
||||
try:
|
||||
noderange = args[0]
|
||||
operation = args[1]
|
||||
if operation == 'attach':
|
||||
if operation in ('attach', 'upload'):
|
||||
media = args[2]
|
||||
except IndexError:
|
||||
argparser.print_help()
|
||||
|
@ -111,7 +111,11 @@ def list_updates(nodes, tenant, element, type='firmware'):
|
||||
else:
|
||||
myparty = updatesbytarget
|
||||
verb = 'update'
|
||||
if len(element) > 4:
|
||||
if type == 'firmware':
|
||||
specificlen = 4
|
||||
else:
|
||||
specificlen = 2
|
||||
if len(element) > specificlen:
|
||||
showmode = True
|
||||
upid = element[-1]
|
||||
for node in nodes:
|
||||
|
Loading…
Reference in New Issue
Block a user