Skip to content

Commit

Permalink
Fix runtime error ModuleNotFoundError: No module named 'libvirt'
Browse files Browse the repository at this point in the history
  • Loading branch information
LiliDeng authored and squirrelsc committed Jan 31, 2025
1 parent 01a7502 commit d6d5118
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions microsoft/testsuites/cvm/cvm_attestation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Licensed under the MIT license.
import base64
from pathlib import Path
from typing import Any, Dict
from typing import TYPE_CHECKING, Any, Dict

from lisa import (
Environment,
Expand All @@ -15,7 +15,6 @@
from lisa.features.security_profile import CvmEnabled
from lisa.operating_system import CBLMariner, Ubuntu
from lisa.sut_orchestrator import AZURE, CLOUD_HYPERVISOR
from lisa.sut_orchestrator.libvirt.context import NodeContext
from lisa.testsuite import TestResult, simple_requirement
from lisa.tools import Ls, Lscpu
from lisa.tools.lscpu import CpuType
Expand All @@ -26,6 +25,9 @@
SnpGuest,
)

if TYPE_CHECKING:
from lisa.sut_orchestrator.libvirt.context import NodeContext


@TestSuiteMetadata(
area="cvm",
Expand Down Expand Up @@ -136,7 +138,7 @@ def verify_nested_cvm_attestation_report(
host_data,
)

def _get_host_data(self, node_context: NodeContext) -> str:
def _get_host_data(self, node_context: "NodeContext") -> str:
# Based on libvirt version our libvirt platform will set
# either plain text or b64 encoded string as host data.
# We need to decode it as this test would get host_data
Expand Down

0 comments on commit d6d5118

Please sign in to comment.