diff options
author | David Schwarz <david.schwarz@calxeda.com> | 2012-11-27 14:52:27 -0600 |
---|---|---|
committer | David Schwarz <david.schwarz@calxeda.com> | 2012-11-27 14:52:27 -0600 |
commit | 6fd468f9a14cad95ce9fea1cf3d6ccfe4c1e42ff (patch) | |
tree | 3b791e7d05685c3a0e1dc8bff2e6ce3dc4f26528 | |
parent | 683686aaca6774b6a0ddac678c53f2be9540dbbb (diff) | |
download | cxmanage-6fd468f9a14cad95ce9fea1cf3d6ccfe4c1e42ff.tar.gz |
Don't try to verify an Image until it's finished being constructed
-rw-r--r-- | cxmanage_api/image.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/cxmanage_api/image.py b/cxmanage_api/image.py index bf2c8c9..ce11f02 100644 --- a/cxmanage_api/image.py +++ b/cxmanage_api/image.py @@ -73,15 +73,17 @@ class Image: if (not os.path.exists(filename)): raise ValueError("File %s does not exist" % filename) - if (not self.verify()): - raise InvalidImageError("%s is not a valid %s image" % - (filename, image_type)) + if (simg == None): contents = open(filename).read() self.simg = has_simg(contents) else: self.simg = simg + if (not self.verify()): + raise InvalidImageError("%s is not a valid %s image" % + (filename, image_type)) + def upload(self, tftp, priority, daddr): """Creates & upload an SIMG file. |