image_manager: Delete image dir if same version exists

If the uploaded version already exists, no version D-Bus object
is created, but the directory in /tmp/ with the image files
remain even though there is no use for it, also there is no way for
the user to delete it except rebooting the BMC. This takes up space
and may cause subsequent uploads to fail with out-of-space. Delete
it if the version already exists.

Tested: Uploading the same image deletes the dir in /tmp.

Change-Id: I9518f8132c18c2e7a20e330e8f894caa7bab6236
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
1 file changed