Beispiel #1
0
    def get_changes(self):
        """ Grab all changes for confirmation """
        change_list = [action.Action("delete", self.auto_device)]

        auto = auto_partition.AutoPartition(
            dest_dir=DEST_DIR,
            auto_device=self.auto_device,
            use_luks=self.settings.get("use_luks"),
            luks_password=self.settings.get("luks_root_password"),
            use_lvm=self.settings.get("use_lvm"),
            use_home=self.settings.get("use_home"),
            bootloader=self.settings.get("bootloader"),
            callback_queue=self.callback_queue)

        devices = auto.get_devices()
        mount_devices = auto.get_mount_devices()
        fs_devices = auto.get_fs_devices()

        mount_points = {}
        for mount_point in mount_devices:
            device = mount_devices[mount_point]
            mount_points[device] = mount_point

        for device in sorted(fs_devices.keys()):
            try:
                txt = _("Device {0} will be created ({1} filesystem) as {2}")
                txt = txt.format(device, fs_devices[device],
                                 mount_points[device])
            except KeyError:
                txt = _("Device {0} will be created ({1} filesystem)")
                txt = txt.format(device, fs_devices[device])
            act = action.Action("info", txt)
            change_list.append(act)

        return change_list
Beispiel #2
0
 def append_change(self, action_type, device, info=""):
     """ Add change for summary screen """
     if action_type == "create":
         info = _("Create {0} on device {1}").format(info, device)
         encrypt = self.zfs_options["encrypt_disk"]
         act = action.Action("info", info, True, True, "", encrypt)
     elif action_type == "add":
         info = _("Add device {0} to {1}").format(device, info)
         encrypt = self.zfs_options["encrypt_disk"]
         act = action.Action("info", info, True, True, "", encrypt)
     elif action_type == "delete":
         act = action.Action(action_type, device)
     self.change_list.append(act)