activation: Replace exists() with is_symlink()/is_directory()
When the symlink is pointing to a directory that doesn't exist,
the exists() check returns false even though the symlink exists,
causing the symlink to not be removed so a failure occurs when
changing the symlink to point to a new version.
Check instead via is_symlink which doesn't care if the target
that the symlink is pointing at exists or not.
This could happen when the user deletes the image that the
symlink is pointing at before activating a new image.
Also use is_directory() to check for directory existance.
Change-Id: Id4548c2f3292b5460317951334d9151e2c4fbab7
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
1 file changed