version manager: Check all software objects

For uploaded tarball, the version manager will check if there is
an existing version, and log "Software Object with the same version
already exists" error.
However it only checks the versions that it creates, but not for
existing versions on D-Bus.

This commit adds additional check, by getting all software objects and
check if the uploaded version exists or not.

Tested: On a BMC running a version, upload the same BMC tarball.
        Before this change, it creates a version object at the same
        D-Bus path;
        With this commit, it logs "Software Object with the same version
        already exists", and REST API returns 400 Bad Request, with
        "description": "Version already exists or failed to be
        extracted"

Signed-off-by: Lei YU <mine260309@gmail.com>
Change-Id: I0532ea99eb330060f61c9bbfea4bf2bd746432a7
1 file changed