@@ -5100,9 +5100,10 @@ class volume(GeneratedsSuper):
51005100 """Specify which parts of the filesystem should be on an extra volume."""
51015101 subclass = None
51025102 superclass = None
5103- def __init__ (self , copy_on_write = None , filesystem_check = None , freespace = None , mountpoint = None , label = None , name = None , parent = None , size = None , arch = None ):
5103+ def __init__ (self , copy_on_write = None , quota = None , filesystem_check = None , freespace = None , mountpoint = None , label = None , name = None , parent = None , size = None , arch = None ):
51045104 self .original_tagname_ = None
51055105 self .copy_on_write = _cast (bool , copy_on_write )
5106+ self .quota = _cast (None , quota )
51065107 self .filesystem_check = _cast (bool , filesystem_check )
51075108 self .freespace = _cast (None , freespace )
51085109 self .mountpoint = _cast (None , mountpoint )
@@ -5124,6 +5125,8 @@ def factory(*args_, **kwargs_):
51245125 factory = staticmethod (factory )
51255126 def get_copy_on_write (self ): return self .copy_on_write
51265127 def set_copy_on_write (self , copy_on_write ): self .copy_on_write = copy_on_write
5128+ def get_quota (self ): return self .quota
5129+ def set_quota (self , quota ): self .quota = quota
51275130 def get_filesystem_check (self ): return self .filesystem_check
51285131 def set_filesystem_check (self , filesystem_check ): self .filesystem_check = filesystem_check
51295132 def get_freespace (self ): return self .freespace
@@ -5140,6 +5143,13 @@ def get_size(self): return self.size
51405143 def set_size (self , size ): self .size = size
51415144 def get_arch (self ): return self .arch
51425145 def set_arch (self , arch ): self .arch = arch
5146+ def validate_partition_size_type (self , value ):
5147+ # Validate type partition-size-type, a restriction on xs:token.
5148+ if value is not None and Validate_simpletypes_ :
5149+ if not self .gds_validate_simple_patterns (
5150+ self .validate_partition_size_type_patterns_ , value ):
5151+ warnings_ .warn ('Value "%s" does not match xsd pattern restrictions: %s' % (value .encode ('utf-8' ), self .validate_partition_size_type_patterns_ , ))
5152+ validate_partition_size_type_patterns_ = [['^(\\ d+|\\ d+M|\\ d+G)$' ]]
51435153 def validate_volume_size_type (self , value ):
51445154 # Validate type volume-size-type, a restriction on xs:token.
51455155 if value is not None and Validate_simpletypes_ :
@@ -5185,6 +5195,9 @@ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='
51855195 if self .copy_on_write is not None and 'copy_on_write' not in already_processed :
51865196 already_processed .add ('copy_on_write' )
51875197 outfile .write (' copy_on_write="%s"' % self .gds_format_boolean (self .copy_on_write , input_name = 'copy_on_write' ))
5198+ if self .quota is not None and 'quota' not in already_processed :
5199+ already_processed .add ('quota' )
5200+ outfile .write (' quota=%s' % (quote_attrib (self .quota ), ))
51885201 if self .filesystem_check is not None and 'filesystem_check' not in already_processed :
51895202 already_processed .add ('filesystem_check' )
51905203 outfile .write (' filesystem_check="%s"' % self .gds_format_boolean (self .filesystem_check , input_name = 'filesystem_check' ))
@@ -5228,6 +5241,12 @@ def buildAttributes(self, node, attrs, already_processed):
52285241 self .copy_on_write = False
52295242 else :
52305243 raise_parse_error (node , 'Bad boolean attribute' )
5244+ value = find_attr_value_ ('quota' , node )
5245+ if value is not None and 'quota' not in already_processed :
5246+ already_processed .add ('quota' )
5247+ self .quota = value
5248+ self .quota = ' ' .join (self .quota .split ())
5249+ self .validate_partition_size_type (self .quota ) # validate type partition-size-type
52315250 value = find_attr_value_ ('filesystem_check' , node )
52325251 if value is not None and 'filesystem_check' not in already_processed :
52335252 already_processed .add ('filesystem_check' )
0 commit comments