mirror of
https://github.com/xcat2/confluent.git
synced 2024-12-24 12:11:52 +00:00
More cleanly error on unknown media
Rather than raise ugly unexpected errors and pollute trace log, cleanly handle the likelihood of unknown media.
This commit is contained in:
parent
1c579723cc
commit
d40426ff54
@ -184,7 +184,8 @@ def osimport(imagefile):
|
||||
else:
|
||||
print(repr(rsp))
|
||||
time.sleep(0.5)
|
||||
list(c.delete('/deployment/importing/{0}'.format(shortname)))
|
||||
if shortname:
|
||||
list(c.delete('/deployment/importing/{0}'.format(shortname)))
|
||||
|
||||
if __name__ == '__main__':
|
||||
main(sys.argv)
|
@ -1,4 +1,5 @@
|
||||
#!/usr/bin/python
|
||||
import confluent.exceptions as exc
|
||||
import confluent.messages as msg
|
||||
import eventlet
|
||||
import eventlet.green.select as select
|
||||
@ -428,6 +429,8 @@ class MediaImporter(object):
|
||||
self.worker = None
|
||||
self.profiles = []
|
||||
identity = fingerprint(media)
|
||||
if not identity:
|
||||
raise exc.InvalidArgumentException('Unsupported Media')
|
||||
self.percent = 0.0
|
||||
identity, _ = identity
|
||||
self.phase = 'copying'
|
||||
|
Loading…
Reference in New Issue
Block a user