]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
run.py: Ignore LXD cgroup v2 warning
authorTom Hromatka <tom.hromatka@oracle.com>
Tue, 1 Jun 2021 22:08:13 +0000 (22:08 +0000)
committerTom Hromatka <tom.hromatka@oracle.com>
Thu, 3 Jun 2021 15:39:05 +0000 (09:39 -0600)
On full cgroup v2 systems, LXD raises the following warning:
WARNING: cgroup v2 is not fully supported yet

Add logic to run.py to ignore this warning.  A non-zero return
code or other strings in stderr should still cause a RunError
exception to be raised.

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
ftests/run.py

index ad8f07d2a6f2e3a0c48ce8e7f163b6f88e08c799..7ab4e512086f2e56b50f9b80247190580db26d63 100644 (file)
@@ -53,9 +53,16 @@ class Run(object):
                 "run:\n\tcommand = {}\n\tret = {}\n\tstdout = {}\n\tstderr = {}".format(
                 ' '.join(command), ret, out, err))
 
-        if ret != 0 or len(err) > 0:
+        if ret != 0:
             raise RunError("Command '{}' failed".format(''.join(command)),
                            command, ret, out, err)
+        if ret != 0 or len(err) > 0:
+            if err.find("WARNING: cgroup v2 is not fully supported yet") == -1:
+                # LXD throws the above warning on systems that are fully
+                # running cgroup v2.  Ignore this warning, but fail if any
+                # other warnings/errors are raised
+                raise RunError("Command '{}' failed".format(''.join(command)),
+                               command, ret, out, err)
 
         return out