Skip to content

Commit 9fbb868

Browse files
authored
Update obsolete libvirt module error message (kevoreilly#2916)
* Modernise obsolute error message * remove references to libvirt_installer * reword message
1 parent d378e70 commit 9fbb868

4 files changed

Lines changed: 5 additions & 6 deletions

File tree

docs/book/src/usage/start.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,8 @@ If you used poetry to install dependencies, you should launch cape with the foll
4848

4949
$ sudo -u cape poetry run python3 cuckoo.py
5050

51-
If you get any dependency-related error, make sure you execute the **extra/libvirt_installer.sh** script::
51+
If you get any dependency-related error, make sure the cape service is using the python environment configured by the installer.
5252

53-
$ sudo -u cape poetry run extra/libvirt_installer.sh
5453

5554
Troubleshooting
5655
===============

lib/cuckoo/common/abstracts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ class LibVirtMachinery(Machinery):
435435
def __init__(self):
436436
if not HAVE_LIBVIRT:
437437
raise CuckooDependencyError(
438-
"Unable to import libvirt. Ensure that you properly installed it by running: cd /opt/CAPEv2/ ; sudo -u cape poetry run extra/libvirt_installer.sh"
438+
"Unable to import libvirt. Ensure cape is being run from the same python environment configured by the installer script."
439439
)
440440

441441
super().__init__()

lib/cuckoo/core/startup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,8 +332,8 @@ def check_snapshot_state():
332332
from xml.etree import ElementTree
333333
except ImportError:
334334
raise CuckooStartupError(
335-
"The 'libvirt-python' library is required for KVM/QEMU machinery but is not installed. "
336-
"Please install it (e.g., 'cd /opt/CAPEv2/ ; sudo -u cape /etc/poetry/bin/poetry run extra/libvirt_installer.sh')."
335+
"The 'libvirt-python' library is required for KVM/QEMU machinery but could not be imported. "
336+
"Please ensure that CAPE is being launched by the same Python environment configured by the install script."
337337
)
338338

339339
machinery_config = Config(cuckoo.cuckoo.machinery)

web/guac/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
LIBVIRT_AVAILABLE = True
1010
except ImportError:
11-
print("Missed python-libvirt. Use extra/libvirt_installer.sh")
11+
print("Unable to import python-libvirt. Check that the CAPE python environment has it installed.")
1212
LIBVIRT_AVAILABLE = False
1313

1414
machinery = Config().cuckoo.machinery

0 commit comments

Comments
 (0)