E2E test: don't remove key if key is nil

What does this MR do and why?

In tests that create SSH keys, if the key isn't created, skip removal.

Previously if a key was not created, the test would generate two failures, one for the generation of the key failing, and then another when trying to remove the key in the after/around block (since it is nil)

Example: https://ops.gitlab.net/gitlab-org/quality/staging/-/jobs/14710322#L385

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports

Loading