Esempio n. 1
0
 def validate_max_user_jobs(self):
     """Validate self.max_user_jobs"""
     if (not isinstance(self.max_user_jobs, int)
             or self.max_user_jobs < -1):
         raise ValidationError(
             "'max_user_jobs' should be an integer greater or equal to '-1'"
         )
Esempio n. 2
0
 def validate_max_processors_per_node(self):  # pylint: disable=invalid-name
     """Validate self.max_processors_per_node"""
     if (not isinstance(self.max_processors_per_node, int)
             or self.max_processors_per_node < -1):
         raise ValidationError(
             "'max_processors_per_node' should be an integer "
             "greater or equal to '-1'")
Esempio n. 3
0
 def validate_type(self):
     """Validate self.type"""
     if self.type != BaseSystem.TYPES.EXECUTION:
         raise ValidationError(
             "Execution system type must be {execution_type}".format(
                 storage_type=BaseSystem.TYPES.EXECUTION
             )
         )
Esempio n. 4
0
 def validate_type(self):
     """Validate self.type"""
     if self.type != BaseSystem.TYPES.STORAGE:
         raise ValidationError(
             "Storage system type must be {storage_type}".format(
                 storage_type=BaseSystem.TYPES.STORAGE
             )
         )
Esempio n. 5
0
 def validate_protocol(self):
     """Validate self.protocol"""
     # pylint: disable=protected-access
     protocols = BaseSystem._LOGIN_PROTOCOLS
     if self.protocol not in protocols:
         raise ValidationError(
             "'protocol' should be one of: {protocols}".format(
                 protocols=protocols))
Esempio n. 6
0
 def validate_status(self):
     """Validate self.status"""
     statuses = ['UP', 'DOWN', 'UNKNOWN']
     if self.status not in statuses:
         raise ValidationError(
             "'status' should be one of: {statuses}".format(
                 statuses=statuses
             )
         )
Esempio n. 7
0
 def validate_id(self):
     """Validate self.id"""
     if not self.id:
         raise ValidationError(
             "'id' should not be empty"
         )
Esempio n. 8
0
 def validate_name(self):
     """Validat self.name"""
     if not self.name:
         raise ValidationError(
             "'name' should not be empty"
         )
Esempio n. 9
0
 def validate_global_default(self):
     """Validate self.default"""
     if not isinstance(self.global_default, bool):
         raise ValidationError(
             "'global_default' should be of type 'bool'"
         )
Esempio n. 10
0
 def validate_public(self):
     """Validate self.public"""
     if not isinstance(self.public, bool):
         raise ValidationError(
             "'public' should be of type 'bool'"
         )
Esempio n. 11
0
 def validate_available(self):
     """validate self.available"""
     if not isinstance(self.available, bool):
         raise ValidationError(
             "'available' should be of type 'bool'"
         )
Esempio n. 12
0
 def validate_custom_directives(self):
     """Validate self.custom_directives"""
     if (self.custom_directives
             and not isinstance(self.custom_directives, str)):
         raise ValidationError("'custom_directives' should be type 'str'")
Esempio n. 13
0
 def validate_max_requested_time(self):
     """Validate self.max_requested_time"""
     if not self.max_requested_time:
         raise ValidationError("'max_requested_time' should not be empty")
Esempio n. 14
0
 def validate_mirror(self):
     """Validate self.mirror"""
     if not isinstance(self.mirror, bool):
         raise ValidationError("'mirror' should be 'bool'")
Esempio n. 15
0
 def validate_host(self):
     """Validate self.host"""
     if not self.host:
         raise ValidationError("'host' should not be empty")
Esempio n. 16
0
 def validate_port(self):
     """Validate self.port"""
     if not self.port:
         raise ValidationError("'port' should not be empty")
Esempio n. 17
0
 def validate_home_dir(self):
     """Validate self.home_dir"""
     if not self.home_dir:
         raise ValidationError("'home_dir' should not be empty")
Esempio n. 18
0
 def validate_root_dir(self):
     """Validate self.root_dir"""
     if not self.root_dir:
         raise ValidationError("'root_dir' should not be empty")
Esempio n. 19
0
 def validate_max_memory_per_node(self):
     """Validate self.max_memory_per_node"""
     if not self.max_memory_per_node:
         raise ValidationError("'max_memory_per_node' should not be empty")
Esempio n. 20
0
 def validate_name(self):
     """Validate self.name"""
     if not self.name:
         raise ValidationError("Metadata record must have a name")