Beispiel #1
0
    def flush(self):
        result = dict(changed=False, stdout=list())

        if self._check_mode:
            result["changed"] = True
            return result

        try:
            output = self._methods["run"](
                "run",
                utilCmdArgs="{0}".format(
                    " ".join(str(a) for a in self._params.values())
                ),
            )
            result["changed"] = True
        except Exception as exc:
            err_msg = "Cannot generate the Qkview file."
            err_msg += ' The error message was "{0}".'.format(str(exc))
            raise AnsibleF5Error(err_msg)

        if hasattr(output, "commandResult"):
            result["stdout"].append(str(output.commandResult))
        result["stdout_lines"] = list(to_lines(result["stdout"]))

        return result
    def flush(self):
        result = dict(changed=False, stdout=list())

        if self._check_mode:
            result["changed"] = True
            return result

        try:
            output = self._methods["run"](
                "run",
                utilCmdArgs="{0}/{2} {1}/{2}".format(
                    self._params["sourcePath"],
                    self._params["destPath"],
                    self._params["fileName"],
                ),
            )
            result["changed"] = True
        except Exception as exc:
            err_msg = "Cannot move the file."
            err_msg += ' The error message was "{0}".'.format(str(exc))
            raise AnsibleF5Error(err_msg)

        if hasattr(output, "commandResult"):
            result["stdout"].append(str(output.commandResult))
        result["stdout_lines"] = list(to_lines(result["stdout"]))

        return result
Beispiel #3
0
    def flush(self):
        result = dict(changed=False, stdout=list())

        try:
            stats = self._read()
        except Exception:
            raise AnsibleF5Error("Unable to retrieve stats.")

        if hasattr(stats, "apiRawValues"):
            result["stdout"].append(stats.apiRawValues["apiAnonymous"])

        result["stdout_lines"] = list(to_lines(result["stdout"]))

        return result
    def flush(self):
        result = dict(changed=False, stdout=list())

        try:
            output = self._methods["run"](
                "run", utilCmdArgs=self._params["cipherString"])
            # result['changed'] = True
        except Exception:
            raise AnsibleF5Error(
                "Could not execute the Client SSL Ciphers command.")

        if hasattr(output, "commandResult"):
            result["stdout"].append(str(output.commandResult))
        result["stdout_lines"] = list(to_lines(result["stdout"]))

        return result
Beispiel #5
0
    def flush(self):
        result = dict(changed=False, stdout=list())

        try:
            output = self._methods["list"]("run",
                                           utilCmdArgs=self._params["path"])
            # result['changed'] = True
        except Exception as exc:
            err_msg = "Cannot show the contents of this folder."
            err_msg += ' The error message was "{0}".'.format(str(exc))
            raise AnsibleF5Error(err_msg)

        if hasattr(output, "commandResult"):
            result["stdout"].append(str(output.commandResult))
        result["stdout_lines"] = list(to_lines(result["stdout"]))

        return result
    def flush(self):
        result = dict(changed=False, stdout=list())

        if self._check_mode:
            result["changed"] = True
            return result

        try:
            output = self._methods["run"]("run",
                                          utilCmdArgs=self._params["cmdArgs"])
            result["changed"] = True
        except Exception as exc:
            err_msg = "Could not execute the Bash command."
            err_msg += ' The error message was "{0}".'.format(str(exc))
            raise AnsibleF5Error(err_msg)

        if hasattr(output, "commandResult"):
            result["stdout"].append(str(output.commandResult))
        result["stdout_lines"] = list(to_lines(result["stdout"]))

        return result