summaryrefslogtreecommitdiff
path: root/tests/integration_tests/conftest.py
diff options
context:
space:
mode:
authorJames Falcon <james.falcon@canonical.com>2022-02-03 15:37:14 -0600
committerGitHub <noreply@github.com>2022-02-03 15:37:14 -0600
commit3f0918b57c6042de99da25bc6a9d120a074b8a8e (patch)
tree858bd67b4f66a059da101a521e96bb15b512f815 /tests/integration_tests/conftest.py
parent6127f3f63df8b8229f67f26c1ba3f4220f93f509 (diff)
downloadvyos-cloud-init-3f0918b57c6042de99da25bc6a9d120a074b8a8e.tar.gz
vyos-cloud-init-3f0918b57c6042de99da25bc6a9d120a074b8a8e.zip
Integration test changes (#1240)
* Wrap the log fetching code in a try/except in case file is missing * Stop checking NoCloud seed dir when testing datasource detection
Diffstat (limited to 'tests/integration_tests/conftest.py')
-rw-r--r--tests/integration_tests/conftest.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/integration_tests/conftest.py b/tests/integration_tests/conftest.py
index b2bc9eb7..a90a5d49 100644
--- a/tests/integration_tests/conftest.py
+++ b/tests/integration_tests/conftest.py
@@ -206,7 +206,11 @@ def _collect_logs(
os.symlink(log_dir.parent, last_symlink)
tarball_path = log_dir / "cloud-init.tar.gz"
- instance.pull_file("/var/tmp/cloud-init.tar.gz", tarball_path)
+ try:
+ instance.pull_file("/var/tmp/cloud-init.tar.gz", tarball_path)
+ except Exception as e:
+ log.error("Failed to pull logs: %s", e)
+ return
tarball = TarFile.open(str(tarball_path))
tarball.extractall(path=str(log_dir))