ItemUpdater::erase() : Fixed double delete

In some cases, when the erase function is called, it attempts
to erase an image that is no longer present on the bmc. This
results in the following error "Error deleting image (/xyz/
openbmc_project/software/xxxxxxxx) from image manager: sd_bus_call
noreply: org.freedesktop.DBus.Error.UnknownObject: Unknown object
'/xyz/openbmc_project/software/xxxxxxxx'". This function should
only be attempting to erase images that exist.

Tested:
Case 1: When activating a new image and the process calls the
erase function on its own
Case 2: When calling delete from the BMC command line
Case 3: When calling delete all from the BMC command line

All of the above cases did not throw the aforementioned error

Signed-off-by: Zami Seck <zimzam17@gmail.com>
Change-Id: I66f8734bcaf8cf31f2b009e53c20d59ee26fd5ad
1 file changed