File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
tasks/kernel_matrix_testing Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -127,6 +127,31 @@ def init_kernel_matrix_testing_system(
127
127
128
128
get_compiler (ctx ).start ()
129
129
130
+ if not remote_setup_only :
131
+ libvirt_version = get_libvirt_version (ctx )
132
+ if libvirt_version is None :
133
+ raise Exit (
134
+ "libvirtd not found in $PATH, this should have been installed previously by the method kmt_os.init_local"
135
+ )
136
+
137
+ info (f"[+] Installing libvirt-python=={ libvirt_version } to match local libvirt version" )
138
+ ctx .run (f"{ sys .executable } -m pip install libvirt-python=={ libvirt_version } " )
139
+
130
140
cm = ConfigManager ()
131
141
cm .config ["setup" ] = "remote" if remote_setup_only else "full"
132
142
cm .save ()
143
+
144
+
145
+ def get_libvirt_version (ctx : Context ) -> str | None :
146
+ """
147
+ Returns the version of libvirt installed on the system. If the version is not found, returns None.
148
+ """
149
+ res = ctx .run ("libvirtd --version" , warn = True )
150
+ if res is None :
151
+ return None
152
+
153
+ parts = res .stdout .strip ().split ()
154
+ if len (parts ) != 3 :
155
+ return None
156
+
157
+ return parts [2 ]
You can’t perform that action at this time.
0 commit comments