From fb515796675ccd387e31866fb5e452357eff90c4 Mon Sep 17 00:00:00 2001 From: Gunnar Mills Date: Thu, 9 Nov 2017 15:52:17 -0600 Subject: 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 --- module/obmc/wsgi/apps/rest_dbus.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- cgit v1.2.1