示例#1
0
 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"
         )
示例#2
0
 def download(self):
     self.download_from_device()
     if os.path.exists(self.want.dest):
         return True
     raise F5ModuleError("Failed to download the remote file")
示例#3
0
 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.")
示例#4
0
 def parent(self):
     if self.want.parent != self.want.parent:
         raise F5ModuleError(
             "The parent monitor cannot be changed"
         )
示例#5
0
 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()
示例#6
0
 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'])
示例#10
0
 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