Ejemplo n.º 1
0
 def route_advertisement(self):
     if self._values['route_advertisement'] is None:
         return None
     version = tmos_version(self.client)
     if LooseVersion(version) <= LooseVersion('13.0.0'):
         if self._values['route_advertisement'] == 'disabled':
             return 'disabled'
         else:
             return 'enabled'
     else:
         return self._values['route_advertisement']
Ejemplo n.º 2
0
    def is_version_with_default_network(self):
        """Is current BIG-IP version missing "default" network value support

        Returns:
            bool: True when it is missing. False otherwise.
        """
        version = tmos_version(self.client)
        if LooseVersion(version) < LooseVersion('13.1.0'):
            return True
        else:
            return False
Ejemplo n.º 3
0
    def is_version_less_than_13(self):
        """Checks to see if the TMOS version is less than 13

        Anything less than BIG-IP 13.x does not support users
        on different partitions.

        :return: Bool
        """
        version = tmos_version(self.client)
        if LooseVersion(version) < LooseVersion('13.0.0'):
            return True
        else:
            return False
Ejemplo n.º 4
0
    def is_version_v1(self):
        """Checks to see if the TMOS version is less than 12.1.0

        Versions prior to 12.1.0 have a bug which prevents the REST
        API from properly listing any UCS files when you query the
        /mgmt/tm/sys/ucs endpoint. Therefore you need to do everything
        through tmsh over REST.

        :return: bool
        """
        version = tmos_version(self.client)
        if LooseVersion(version) < LooseVersion('12.1.0'):
            return True
        else:
            return False
Ejemplo n.º 5
0
    def exec_module(self):
        result = dict()
        changed = False
        state = self.want.state

        version = tmos_version(self.client)
        if LooseVersion(version) <= LooseVersion('12.0.0'):
            raise F5ModuleError(
                "This version of BIG-IP is not supported."
            )

        if state == "present":
            changed = self.present()
        elif state == "absent":
            changed = self.absent()

        changes = self.changes.to_return()
        result.update(**changes)
        result.update(dict(changed=changed))
        return result
Ejemplo n.º 6
0
    def exec_module(self):
        tmos = tmos_version(self.client)
        if LooseVersion(tmos) < LooseVersion('13.0.0'):
            raise F5ModuleError(
                "BIG-IP v13 or greater is required to use this module."
            )
        changed = False
        result = dict()
        state = self.want.state

        if state == "present":
            changed = self.present()
        elif state == "absent":
            changed = self.absent()

        reportable = ReportableChanges(params=self.changes.to_return())
        changes = reportable.to_return()
        result.update(**changes)
        result.update(dict(changed=changed))
        self._announce_deprecations(result)
        return result
Ejemplo n.º 7
0
 def version_is_less_than_13(self):
     version = tmos_version(self.client)
     if LooseVersion(version) < LooseVersion('13.0.0'):
         return True
     else:
         return False
Ejemplo n.º 8
0
    def name(self):
        if self._values['name'] is None:
            return None

        version = tmos_version(self.client)

        if LooseVersion(version) < LooseVersion('13.0.0'):
            name_list = [
                'All Response Signatures',
                'All Signatures',
                'Command Execution Signatures',
                'Cross Site Scripting Signatures',
                'Directory Indexing Signatures',
                'Generic Detection Signatures',
                'HTTP Response Splitting Signatures',
                'High Accuracy Signatures',
                'Information Leakage Signatures',
                'Low Accuracy Signatures',
                'Medium Accuracy Signatures',
                'OS Command Injection Signatures',
                'OWA Signatures',
                'Other Application Attacks Signatures',
                'Path Traversal Signatures',
                'Predictable Resource Location Signatures',
                'Remote File Include Signatures',
                'SQL Injection Signatures',
                'Server Side Code Injection Signatures',
                'WebSphere signatures',
                'XPath Injection Signatures'
            ]
        else:
            name_list = [
                'All Response Signatures',
                'All Signatures',
                'Apache Struts Signatures',
                'Apache Tomcat Signatures',
                'Cisco Signatures',
                'Command Execution Signatures',
                'Cross Site Scripting Signatures',
                'Directory Indexing Signatures',
                'Generic Detection Signatures',
                'HTTP Response Splitting Signatures',
                'High Accuracy Detection Evasion Signatures',
                'High Accuracy Signatures',
                'IIS and Windows Signatures',
                'Information Leakage Signatures',
                'Java Servlets/JSP Signatures',
                'Low Accuracy Signatures',
                'Medium Accuracy Signatures',
                'OS Command Injection Signatures',
                'OWA Signatures',
                'Other Application Attacks Signatures',
                'Path Traversal Signatures',
                'Predictable Resource Location Signatures',
                'Remote File Include Signatures',
                'SQL Injection Signatures',
                'Server Side Code Injection Signatures',
                'WebSphere signatures',
                'XPath Injection Signatures'
            ]

        if self._values['name'] in name_list:
            return self._values['name']

        if self._signature_set_exists_on_device(self._values['name']):
            return self._values['name']

        raise F5ModuleError(
            "The specified signature {0} set does not exist.".format(
                self._values['name']
            )
        )
 def version_less_than_14(self):
     version = tmos_version(self.client)
     if LooseVersion(version) < LooseVersion('14.0.0'):
         return True
     return False
 def _is_v13_and_above(self):
     version = tmos_version(self.client)
     if LooseVersion(version) >= LooseVersion('13.0.0'):
         return True
     return False