def run_command(self, cmd, shell=True, stdin=None):
        """Run a shell command as a subprocess.

        Prints 'cmd' return code if execution failed.

        Args:
            cmd: Command to execute.
            shell: True if shell command should be executed (eg. ls, ps).
            stdin: A custom stdin for the process running the command (defaults
            to None).

        Returns:
            True if command successfully executed, otherwise False.
        """
        result = True
        try:
            ret = call(cmd, shell=shell, stdin=stdin)
            if ret:
                self.print_plugin_error("[ret=%d] Command: %s" % (int(ret), cmd))
                return False
        except Exception as e:
            result = False
            self.print_plugin_error("[ret=%d] Command: %s" % (int(ret), cmd))
            self.print_plugin_error(str(e))
        return result