NetworkManager.Settings.Connection cannot round-trip, calling Update with what GetSettings returned
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- ruby
- Lĩnh vực
- networking
Hướng nghiên cứu
Start with the NetworkManager GetSettings/Update example in the issue, then inspect lib/dbus/bus.rb and lib/dbus/proxy_object_interface.rb where the reported errors arise. Reproduce the empty-value and ipv4.address-data cases and trace how their D-Bus types are inferred. Done means identifying a supported round-trip behavior or a documented workaround for these settings.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
(reported by @imobachgs)
We would like to use ruby-dbus to interact with NetworkManager through D-Bus. The following example tries to use the method to Update a connection. It basically asks for the current configuration (GetSettings) an tries to apply the same configuration (calling Update).
require "dbus"
bus = ::DBus::SystemBus.instance
service = bus.service("org.freedesktop.NetworkManager")
settings_obj = service.object("/org/freedesktop/NetworkManager/Settings")
# find a settings object (a.k.a. connections)
settings_path, *_others = settings_obj["org.freedesktop.NetworkManager.Settings"].ListConnections.first
# set settings configuration
nm_settings = service.object(settings_path)
conn_settings = nm_settings["org.freedesktop.NetworkManager.Settings.Connection"].GetSettings.first
puts "Current configuration", conn_settings.inspect
nm_settings.Update(conn_settings)
However, it fails because data types for empty values (empty arrays and hashes) are not what NetworkManager expects. Our guess is that there is no typing information available, so ruby-dbus cannot figure out what to send in such cases.
/usr/lib64/ruby/gems/3.1.0/gems/ruby-dbus-0.18.1/lib/dbus/bus.rb:364:in `block in send_sync_or_async': connection.permissions: wrong type; should be a list of strings.; caused by 3 sender=:1.7 -> dest=:1.499 serial=1943 reply_serial=12 path=; interface=; member= error_name=org.freedesktop.NetworkManager.Settings.Connection.InvalidProperty (DBus::Error)
from /usr/lib64/ruby/gems/3.1.0/gems/ruby-dbus-0.18.1/lib/dbus/bus.rb:552:in `process'
from /usr/lib64/ruby/gems/3.1.0/gems/ruby-dbus-0.18.1/lib/dbus/bus.rb:486:in `send_sync'
from /usr/lib64/ruby/gems/3.1.0/gems/ruby-dbus-0.18.1/lib/dbus/bus.rb:363:in `send_sync_or_async'
from /usr/lib64/ruby/gems/3.1.0/gems/ruby-dbus-0.18.1/lib/dbus/proxy_object_interface.rb:70:in `block (2 levels) in define_method_from_descriptor'
from /usr/lib64/ruby/gems/3.1.0/gems/ruby-dbus-0.18.1/lib/dbus/proxy_object.rb:113:in `call'
from /usr/lib64/ruby/gems/3.1.0/gems/ruby-dbus-0.18.1/lib/dbus/proxy_object.rb:113:in `block (3 levels) in define_shortcut_methods'
from a.rb:16:in `<main>'
/usr/lib64/ruby/gems/3.1.0/gems/ruby-dbus-0.18.1/lib/dbus/bus.rb:364:in `block in send_sync_or_async': connection.permissions: wrong type; should be a list of strings. (DBus::Error)
from /usr/lib64/ruby/gems/3.1.0/gems/ruby-dbus-0.18.1/lib/dbus/bus.rb:552:in `process'
from /usr/lib64/ruby/gems/3.1.0/gems/ruby-dbus-0.18.1/lib/dbus/bus.rb:486:in `send_sync'
from /usr/lib64/ruby/gems/3.1.0/gems/ruby-dbus-0.18.1/lib/dbus/bus.rb:363:in `send_sync_or_async'
from /usr/lib64/ruby/gems/3.1.0/gems/ruby-dbus-0.18.1/lib/dbus/proxy_object_interface.rb:70:in `block (2 levels) in define_method_from_descriptor'
from /usr/lib64/ruby/gems/3.1.0/gems/ruby-dbus-0.18.1/lib/dbus/proxy_object.rb:113:in `call'
from /usr/lib64/ruby/gems/3.1.0/gems/ruby-dbus-0.18.1/lib/dbus/proxy_object.rb:113:in `block (3 levels) in define_shortcut_methods'
from change-nm.rb:16:in `<main>'
Even if we do not send any empty attribute (cleaning up the settings), we find an additional problem with ipv4.address-data:
/usr/lib64/ruby/gems/3.1.0/gems/ruby-dbus-0.18.1/lib/dbus/bus.rb:364:in `block in send_sync_or_async': ipv4.address-data: can't set property of type 'aa{sv}' from value of type 'av'; caused by 3 sender=:1.7 -> dest=:1.545 serial=2082 reply_serial=12 path=; interface=; member= error_name=org.freedesktop.NetworkManager.Settings.Connection.InvalidProperty (DBus::Error)
Are our assumptions right? Do we have a way to workaround this problem?
Thanks!
- Ngôn ngữ chính
- Ruby
- Star
- 174
- Fork
- 50
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của mvidner/ruby-dbus
-
Specify rexml versioningĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
-
Rexml or Nokogiri?Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
-
good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 45/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
-
UNIX_FD in practice?Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 32/100
Tất cả issue của mvidner/ruby-dbus
Issue tương tự
-
Add ZammadCó thể đã có người làm @Arslan-TR đã nhận hôm nay. Đang mởrequest
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
endoflife-date/endoflife.date#11298 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
performance v/6
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
WITCodingClub/calendar-backend#689 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
rubys/roundhouse#571 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area/web interface
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
mastodon/mastodon#40924 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày