Class: DInstaller::DBus::Storage::Proposal
- Inherits:
-
BaseObject
- Object
- DBus::Object
- BaseObject
- DInstaller::DBus::Storage::Proposal
- Includes:
- Interfaces::ServiceStatus, WithServiceStatus
- Defined in:
- lib/dinstaller/dbus/storage/proposal.rb
Overview
D-Bus object to manage a storage proposal
Constant Summary
Constants included from Interfaces::ServiceStatus
Interfaces::ServiceStatus::SERVICE_STATUS_BUSY, Interfaces::ServiceStatus::SERVICE_STATUS_IDLE, Interfaces::ServiceStatus::SERVICE_STATUS_INTERFACE
Instance Method Summary collapse
-
#actions ⇒ Array<Hash>
List of sorted actions in D-Bus format.
-
#available_devices ⇒ Array<Array>
List of disks available for installation.
- #candidate_devices ⇒ Object
-
#initialize(backend, logger) ⇒ Proposal
constructor
Constructor.
- #lvm ⇒ Object
Methods included from Interfaces::ServiceStatus
included, #register_service_status_callbacks, #service_status_all, #service_status_current
Methods included from WithServiceStatus
Methods inherited from BaseObject
Constructor Details
#initialize(backend, logger) ⇒ Proposal
Constructor
43 44 45 46 47 48 49 |
# File 'lib/dinstaller/dbus/storage/proposal.rb', line 43 def initialize(backend, logger) super(PATH, logger: logger) @backend = backend register_callbacks register_service_status_callbacks end |
Instance Method Details
#actions ⇒ Array<Hash>
List of sorted actions in D-Bus format
113 114 115 |
# File 'lib/dinstaller/dbus/storage/proposal.rb', line 113 def actions backend.actions.all.map { |a| action_to_dbus(a) } end |
#available_devices ⇒ Array<Array>
List of disks available for installation
Each device is represented by an array containing id and UI label. See the documentation of the available_devices DBus reader.
88 89 90 91 92 |
# File 'lib/dinstaller/dbus/storage/proposal.rb', line 88 def available_devices backend.available_devices.map do |dev| [dev.name, backend.device_label(dev), {}] end end |
#candidate_devices ⇒ Object
102 103 104 105 106 |
# File 'lib/dinstaller/dbus/storage/proposal.rb', line 102 def candidate_devices backend.candidate_devices rescue DInstaller::Storage::Proposal::NoProposalError [] end |
#lvm ⇒ Object
95 96 97 98 99 |
# File 'lib/dinstaller/dbus/storage/proposal.rb', line 95 def lvm backend.lvm? rescue DInstaller::Storage::Proposal::NoProposalError false end |