예제 #1
0
    def validate(self):
        '''Ensure the Solaris partition or ZFS Root exists and is large
        enough
        
        '''
        disk_info = self.disk_win.disk_info
        if self.is_x86 and not self.x86_slice_mode:
            min_size_text = _("The Solaris2 partition must be at least"
                              " %(size).1fGB")
            missing_part = _("There must be exactly one Solaris2 partition.")
        else:
            min_size_text = _("The size of %(pool)s must be at least"
                              " %(size).1fGB")
            missing_part = _("There must be one ZFS root pool, '%(pool)s.'")
        min_size = round(get_minimum_size().size_as("gb"), 1)
        format_dict = {'pool': SliceInfo.DEFAULT_POOL, 'size': min_size}

        try:
            part = disk_info.get_solaris_data(check_multiples=True)
        except ValueError:
            part = None

        if part is None:
            raise UIMessage(missing_part % format_dict)

        # When comparing sizes, check only to the first decimal place,
        # as that is all the user sees. (Rounding errors that could
        # cause the partition/slice layout to be invalid get cleaned up
        # prior to target instantiation)
        part_size = round(part.size.size_as("gb"), 1)
        if part_size < min_size:
            raise UIMessage(min_size_text % format_dict)
 def validate(self):
     '''Ensure the Solaris partition or ZFS Root exists and is large
     enough
     
     '''
     disk_info = self.disk_win.disk_info
     if self.is_x86 and not self.x86_slice_mode:
         min_size_text = _("The Solaris2 partition must be at least"
                           " %(size).1fGB")
         missing_part = _("There must be exactly one Solaris2 partition.")
     else:
         min_size_text = _("The size of %(pool)s must be at least"
                           " %(size).1fGB")
         missing_part = _("There must be one ZFS root pool, '%(pool)s.'")
     min_size = round(get_minimum_size().size_as("gb"), 1)
     format_dict = {'pool' : SliceInfo.DEFAULT_POOL,
                    'size': min_size}
     
     try:
         part = disk_info.get_solaris_data(check_multiples=True)
     except ValueError:
         part = None
     
     if part is None:
         raise UIMessage(missing_part % format_dict)
     
     # When comparing sizes, check only to the first decimal place,
     # as that is all the user sees. (Rounding errors that could
     # cause the partition/slice layout to be invalid get cleaned up
     # prior to target instantiation)
     part_size = round(part.size.size_as("gb"), 1)
     if part_size < min_size:
         raise UIMessage(min_size_text % format_dict)
예제 #3
0
 def determine_size_data(self):
     '''Retrieve the minimum and recommended sizes and generate the string
     to present that information.
     
     '''
     if self._minimum_size is None or self._recommended_size is None:
         self._recommended_size = get_recommended_size().size_as("gb")
         self._minimum_size = get_minimum_size().size_as("gb")
예제 #4
0
 def determine_size_data(self):
     '''Retrieve the minimum and recommended sizes and generate the string
     to present that information.
     
     '''
     if self._minimum_size is None or self._recommended_size is None:
         self._recommended_size = get_recommended_size().size_as("gb")
         self._minimum_size = get_minimum_size().size_as("gb")