def _check_link_discovery_requirements(self): if self.want.link_discovery == 'enabled' and self.want.virtual_server_discovery == 'disabled': raise F5ModuleError( "Virtual server discovery must be enabled if link discovery is enabled" )
def download(self): self.download_from_device() if os.path.exists(self.want.dest): return True raise F5ModuleError("Failed to download the remote file")
def _validate_name_in_interface(self, result): if any('name' not in x for x in result[1:]): raise F5ModuleError( "All interfaces, except for the first (mgmt), require a name.")
def parent(self): if self.want.parent != self.want.parent: raise F5ModuleError( "The parent monitor cannot be changed" )
def update(self): if os.path.exists(self.want.fulldest): if not self.want.force: raise F5ModuleError("File '{0}' already exists".format( self.want.fulldest)) self.execute()
def mtu(self): if self._values['mtu'] is None: return None if int(self._values['mtu']) < 576 or int(self._values['mtu']) > 9198: raise F5ModuleError("The mtu value must be between 576 - 9198") return int(self._values['mtu'])
def receive(self): if self._values['receive'] is None: return None raise F5ModuleError( "The 'receive' parameter is not available for TCP half open")
def send(self): if self._values['send'] is None: return None raise F5ModuleError( "The 'send' parameter is not available for TCP half open")
def interval(self): if self._values['interval'] is None: return None if 1 > int(self._values['interval']) > 86400: raise F5ModuleError("Interval value must be between 1 and 86400") return int(self._values['interval'])
def quorum(self): value = self._values['quorum'] error = "Quorum value must be specified with monitor_type 'm_of_n'." if self._values['monitor_type'] == 'm_of_n' and value is None: raise F5ModuleError(error) return value