code: def captureCommand(commandline):
      fd = os.popen(commandline, "r")
      data = fd.read()
      xit = fd.close()
      if xit is not None:
          sys.stdout.write(data)
          raise RuntimeError("command failed: %s" % (commandline,))
  
      return data
  
imports: import platform, os, sys, getopt, textwrap, shutil, stat, time, pwd, grp
label_desc: Use image node_id 18 for calling a global function with example usage: captureCommand(commandline) and returns: data