Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

collect-artifacts: Try to use Libguestfs #656

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lago/plugins/vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,9 @@ def extract_paths(self, paths, ignore_nopath):
Raises:
:exc:`~lago.plugins.vm.ExtractPathNoPathError`: if a none existing
path was found on the VM, and ``ignore_nopath`` is True.
:exc:`~lago.plugins.vm.ExtractPathError`: on all other failures.
:exc:`~lago.plugins.vm.ExtractPathError`: If the vm isn't alive
nor ssh reachable.
:exc:`~scp.SCPException`: If an error occurred during scp.
"""
if self.vm.alive() and self.vm.ssh_reachable(
tries=5, propagate_fail=False
Expand Down
3 changes: 2 additions & 1 deletion lago/providers/libvirt/vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import libvirt
from lxml import etree as ET
from textwrap import dedent
from scp import SCPException

from lago import export, log_utils, sysprep, utils
from lago.utils import LagoException
Expand Down Expand Up @@ -341,7 +342,7 @@ def extract_paths(self, paths, ignore_nopath):
paths=paths,
ignore_nopath=ignore_nopath,
)
except ExtractPathError as err:
except (ExtractPathError, SCPException) as err:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the scp.py module can throw other exceptions(including IOError),
see: jbardin/scp.py#82

LOGGER.debug(
'%s: failed extracting files: %s', self.vm.name(), err.message
)
Expand Down