usr/src/cmd/gui-install/src/disk_screen.py
changeset 1716 0cea9255024f
parent 1644 e827d1934114
child 1752 5c51d42f1aaf
equal deleted inserted replaced
1715:4f7cd5bdc623 1716:0cea9255024f
   379             if selected_disk.disk_prop is None or \
   379             if selected_disk.disk_prop is None or \
   380                 selected_disk.disk_prop.dev_size is None or \
   380                 selected_disk.disk_prop.dev_size is None or \
   381                 selected_disk.disk_prop.dev_size < \
   381                 selected_disk.disk_prop.dev_size < \
   382                 self._target_controller.recommended_target_size:
   382                 self._target_controller.recommended_target_size:
   383 
   383 
   384                 LOGGER.info("Disk smaller than recommended")
   384                 LOGGER.info("Disk smaller than recommended minimum")
   385                 LOGGER.info("Recommended size is %s",
   385                 LOGGER.info("Recommended minimum size is %s",
   386                     self._target_controller.recommended_target_size)
   386                     self._target_controller.recommended_target_size)
   387                 if selected_disk.disk_prop is not None and \
   387                 if selected_disk.disk_prop is not None and \
   388                     selected_disk.disk_prop.dev_size is not None:
   388                     selected_disk.disk_prop.dev_size is not None:
   389                     LOGGER.info("Disk size is (%s)",
   389                     LOGGER.info("Disk size is (%s)",
   390                         selected_disk.disk_prop.dev_size)
   390                         selected_disk.disk_prop.dev_size)
   396                     _("You may have difficulties upgrading the system "
   396                     _("You may have difficulties upgrading the system "
   397                     "software and/or installing and running additional "
   397                     "software and/or installing and running additional "
   398                     "applications."),
   398                     "applications."),
   399                     two_buttons=True)
   399                     two_buttons=True)
   400                 if not ok_to_proceed:
   400                 if not ok_to_proceed:
   401                     self._raise_error("Disk smaller than recommended")
   401                     self._raise_error("Disk smaller than recommended minimum")
   402 
   402 
   403         # WARNING #2 - Solaris partition is smaller than recommended size
   403         # WARNING #2 - Solaris partition is smaller than recommended size
   404         # Identify the correct Solaris Partition or GPTPartition object.
   404         # Identify the correct Solaris Partition or GPTPartition object.
   405         # (not whole_disk only)
   405         # (not whole_disk only)
   406         else:
   406         else:
   410                 solaris_partition = solaris_partyslice
   410                 solaris_partition = solaris_partyslice
   411 
   411 
   412             if solaris_partition.size < \
   412             if solaris_partition.size < \
   413                 self._target_controller.recommended_target_size:
   413                 self._target_controller.recommended_target_size:
   414 
   414 
   415                 LOGGER.info("Partition smaller than recommended")
   415                 LOGGER.info("Partition smaller than recommended minimum")
   416                 LOGGER.info("Recommended size is %s",
   416                 LOGGER.info("Recommended minimum size is %s",
   417                     self._target_controller.recommended_target_size)
   417                     self._target_controller.recommended_target_size)
   418                 LOGGER.info("Partition size is (%s)", solaris_partition.size)
   418                 LOGGER.info("Partition size is (%s)", solaris_partition.size)
   419 
   419 
   420                 ok_to_proceed = modal_dialog(_("The selected partition is "
   420                 ok_to_proceed = modal_dialog(_("The selected partition is "
   421                     "smaller than the recommended minimum size."),
   421                     "smaller than the recommended minimum size."),
   422                     _("You may have difficulties upgrading the system "
   422                     _("You may have difficulties upgrading the system "
   423                     "software and/or installing and running additional "
   423                     "software and/or installing and running additional "
   424                     "applications."),
   424                     "applications."),
   425                     two_buttons=True)
   425                     two_buttons=True)
   426                 if not ok_to_proceed:
   426                 if not ok_to_proceed:
   427                     self._raise_error("Partition smaller than recommended")
   427                     self._raise_error("Partition smaller than recommended " 
       
   428                     "minimum")
   428 
   429 
   429         # Save the TargetController in the DOC (used to retrieve the
   430         # Save the TargetController in the DOC (used to retrieve the
   430         # minimum_target_size and call setup_vfstab_for_swap())
   431         # minimum_target_size and call setup_vfstab_for_swap())
   431         profile = doc.volatile.get_first_child(
   432         profile = doc.volatile.get_first_child(
   432             name="GUI Install",
   433             name="GUI Install",
   692 
   693 
   693     def _set_screen_titles(self):
   694     def _set_screen_titles(self):
   694         # NB This messing about is because we want to re-use the existing
   695         # NB This messing about is because we want to re-use the existing
   695         # localized size formatting string from C, but the Python formatting
   696         # localized size formatting string from C, but the Python formatting
   696         # options are different
   697         # options are different
   697         size_str = _("Recommended size: %lldGB Minimum: %.1fGB")
   698         size_str = _("Recommended minimum: %lldGB Minimum: %.1fGB")
   698         size_str = size_str.replace('%lld', '%s')
   699         size_str = size_str.replace('%lld', '%s')
   699         size_str = size_str.replace('%.1f', '%s')
   700         size_str = size_str.replace('%.1f', '%s')
   700 
   701 
   701         if self._target_controller is None:
   702         if self._target_controller is None:
   702             # Blank out the size values until they are available
   703             # Blank out the size values until they are available