Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix storage config #1854

Merged
merged 2 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions service/lib/agama/dbus/clients/storage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ def finish
#
# @return [Hash]
def config
serialized_config = dbus_object.GetConfig
# Use storage iface to avoid collision with bootloader iface
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting. I wonder if it worth to always use the corresponding iface to avoid more errors like the one this commit fixes and get rid of specific comment.

Something to be discussed, not a blocker for this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, it is zbus way to always use combination of service, interface and object. On other hand ruby-dbus use different way and allow access throught interface, but for simplicity if method in unique, it is added directly to object. My original fix change dbus_object to always return interface, but then mixins start failing as it uses some methods that is not in interface. (during test e.g. this mixins failing https://github.com/agama-project/agama/blob/master/service/lib/agama/dbus/clients/with_service_status.rb#L43 ).
Maybe it will be better to have beside dbus_object also dbus_interface method on which we should call all needed storage methods ( that is idea that I get after thinking a bit more about it after I have working solution and not enough time to test different one ).

serialized_config = dbus_object[STORAGE_IFACE].GetConfig
JSON.parse(serialized_config, symbolize_names: true)
end

Expand All @@ -76,7 +77,8 @@ def config
# @param config [Hash]
def config=(config)
serialized_config = JSON.pretty_generate(config)
dbus_object.SetConfig(serialized_config)
# Use storage iface to avoid collision with bootloader iface
dbus_object[STORAGE_IFACE].SetConfig(serialized_config)
end

private
Expand Down
6 changes: 6 additions & 0 deletions service/package/rubygem-agama-yast.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Dec 23 18:40:01 UTC 2024 - Josef Reidinger <jreidinger@suse.com>

- Fix collision between hotfix and new bootlaoder dbus interface
(gh#agama-project/agama#1852)

-------------------------------------------------------------------
Fri Dec 20 15:05:11 UTC 2024 - José Iván López González <jlopez@suse.com>

Expand Down
Loading