LOG.info(_("Last actions before powering off VM {!r} ...").format(self.tpl_ip))
cmd = textwrap.dedent("""\
- echo
- echo "-----------------------------------------------------------"
- echo "Cleaning up /root/.ssh/authorized_keys ..."
- afile="/root/.ssh/authorized_keys"
- tfile="/tmp/authorized_keys"
- pattern="create-vmware-tpl@pixelpark.com"
-
- cat "${afile}" | grep -v "${pattern}" > "${tfile}"
- mv -v "${tfile}" "${afile}"
-
echo
echo "-----------------------------------------------------------"
echo "Removing SSH host keys ..."