Fix some whitespace and line breaks
authorChristian Herdtweck <christian.herdtweck@intra2net.com>
Mon, 8 Nov 2021 08:23:01 +0000 (09:23 +0100)
committerChristian Herdtweck <christian.herdtweck@intra2net.com>
Mon, 8 Nov 2021 08:23:01 +0000 (09:23 +0100)
src/arnied_wrapper.py
src/simple_cnf.py

index b6d79d0..774e835 100644 (file)
@@ -83,8 +83,9 @@ def run_cmd(cmd="", ignore_errors=False, vm=None, timeout=60):
     :param vm: vm to run on if running on a guest instead of the host
     :type vm: :py:class:`virttest.qemu_vm.VM` or None
     :param int timeout: amount of seconds to wait for the program to run
-    :returns: command result output
-    :rtype: str
+    :returns: command result output where output (stdout/stderr) is bytes
+              (encoding dependent on environment and command given)
+    :rtype: :py:class:`subprocess.CompletedProcess`
     :raises: :py:class:`OSError` if command failed and cannot be ignored
     """
     if vm is not None:
@@ -96,9 +97,11 @@ def run_cmd(cmd="", ignore_errors=False, vm=None, timeout=60):
             stdout = b""
             if not ignore_errors:
                 raise subprocess.CalledProcessError(status, cmd, stderr=stderr)
-        return subprocess.CompletedProcess(cmd, status, stdout=stdout, stderr=stderr)
+        return subprocess.CompletedProcess(cmd, status,
+                                           stdout=stdout, stderr=stderr)
     else:
-        return subprocess.run(cmd, check=not ignore_errors, shell=True, capture_output=True)
+        return subprocess.run(cmd, check=not ignore_errors, shell=True,
+                              capture_output=True)
 
 
 def verify_running(process='arnied', timeout=60, vm=None):
index bd43ccb..cdc4318 100644 (file)
@@ -54,6 +54,7 @@ dict with a single key `cnf` whose value is a list of conf var dicts. (Function
           between them is unclear. Also name differs only in case from
           :py:class:`cnfvar.InvalidCNF`
 
+
 INTERFACE
 ------------------------------------------------------
 """
@@ -320,7 +321,6 @@ class SimpleCnf(object):
             new_var['children'] = children   # only add if non-empty
         self.__cnfvars.append(new_var)
 
-
     def add_single(self, varname, data=u'', number=None):
         """
         Add a single cnf var to config on top level.
@@ -329,7 +329,6 @@ class SimpleCnf(object):
         """
         return self.add (varname, data=data, number=number)
 
-
     def append_file_generic(self, reader, cnf, replacements=None):
         """
         Append conf var data from file.