code: def command_run(self, command):
          
          # convert the command to sequence if a string
          if isinstance(command, basestring):
              command = shlex.split(command)
          try:
              return Popen(command, stdout=PIPE, stderr=PIPE, close_fds=True).wait()
          except Exception as e:
              # make a pretty command for error loggings and...
              if isinstance(command, basestring):
                  pretty_cmd = command
              else:
                  pretty_cmd = " ".join(command)
              msg = "Command `{cmd}` {error}".format(cmd=pretty_cmd, error=e.errno)
              raise exceptions.CommandError(msg, error_code=e.errno)
docs: Runs a command and returns the exit code.
          The command can either be supplied as a sequence or string.
  
          An Exception is raised if an error occurs