summaryrefslogtreecommitdiffstats
path: root/module/obmc/wsgi
diff options
context:
space:
mode:
authorGunnar Mills <gmills@us.ibm.com>2017-11-09 15:52:17 -0600
committerGunnar Mills <gmills@us.ibm.com>2017-11-16 13:26:59 -0600
commitfb515796675ccd387e31866fb5e452357eff90c4 (patch)
tree5fe574ebb3b2e1672c4f9e4020fa75f2165d3223 /module/obmc/wsgi
parent3a00b1fd769320ee4a0e95e26c0f688e30a920bc (diff)
downloadphosphor-rest-server-fb515796675ccd387e31866fb5e452357eff90c4.tar.gz
phosphor-rest-server-fb515796675ccd387e31866fb5e452357eff90c4.zip
Don't create Image Dir if not present
Return error if the Image directory is not present. The Upload code should not create the image dir, instead the code update or the inotify code should create it. Even if the Upload code creates the directory, the inotify is not looking for a file in that dir and won't untar it. We saw this with 2544. Although not the root cause of 2544 this change would have let the user know sooner (on upload), that there was a problem. Change-Id: I9f161354e1c3243567efb73b6974e8f52ff4c5db Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
Diffstat (limited to 'module/obmc/wsgi')
-rw-r--r--module/obmc/wsgi/apps/rest_dbus.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/module/obmc/wsgi/apps/rest_dbus.py b/module/obmc/wsgi/apps/rest_dbus.py
index c44a45d..540322b 100644
--- a/module/obmc/wsgi/apps/rest_dbus.py
+++ b/module/obmc/wsgi/apps/rest_dbus.py
@@ -693,7 +693,7 @@ class ImageUploadUtils:
@classmethod
def do_upload(cls, filename=''):
if not os.path.exists(cls.file_loc):
- os.makedirs(cls.file_loc)
+ abort(500, "Error Directory not found")
if not filename:
handle, filename = tempfile.mkstemp(cls.file_suffix,
cls.file_prefix, cls.file_loc)
OpenPOWER on IntegriCloud