diff options
author | Zhang Qiang <qiang.z.zhang@intel.com> | 2011-10-26 22:20:58 +0800 |
---|---|---|
committer | Zhang Qiang <qiang.z.zhang@intel.com> | 2011-10-26 22:20:58 +0800 |
commit | 9f3a431cb6e9dfda5e12b48b7275e8a51c5e980b (patch) | |
tree | 48e995514df4290f44e141a6302e8f3e810a35d4 /plugins/imager/raw_plugin.py | |
parent | 4d2f3e7e8a9fabea903fed8e5743eced7f7d9d0c (diff) | |
download | mic-9f3a431cb6e9dfda5e12b48b7275e8a51c5e980b.tar.gz mic-9f3a431cb6e9dfda5e12b48b7275e8a51c5e980b.tar.bz2 mic-9f3a431cb6e9dfda5e12b48b7275e8a51c5e980b.zip |
Clean up checking exist image code
Diffstat (limited to 'plugins/imager/raw_plugin.py')
-rw-r--r-- | plugins/imager/raw_plugin.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/plugins/imager/raw_plugin.py b/plugins/imager/raw_plugin.py index 0e9a3fc..6276241 100644 --- a/plugins/imager/raw_plugin.py +++ b/plugins/imager/raw_plugin.py @@ -78,14 +78,11 @@ class RawPlugin(ImagerPlugin): if len(recording_pkgs) > 0: creator._recording_pkgs = recording_pkgs - destdir = os.path.abspath(os.path.expanduser(creatoropts["outdir"])) - imagefile = "%s-sda.raw" % os.path.join(destdir, creator.name) - - if not os.path.exists(destdir): - os.makedirs(destdir) - elif os.path.exists(imagefile): - if msger.ask('The target image: %s already exists, need to delete it?' % imagefile): - os.unlink(imagefile) + if creatoropts['release'] is None: + imagefile = "%s-sda.raw" % os.path.join(creator.destdir, creator.name) + if os.path.exists(imagefile): + if msger.ask('The target image: %s already exists, need to delete it?' % imagefile): + os.unlink(imagefile) try: creator.check_depend_tools() |