Skip to content
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
10 changes: 10 additions & 0 deletions service/.rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ AllCops:
- vendor/**/*
- lib/dinstaller/dbus/y2dir/**/*

# a D-Bus method definition may take up more line lenght than usual
Layout/LineLength:
IgnoredPatterns:
- dbus_method

# a D-Bus interface definition may take up more lines than a regular method
Metrics/BlockLength:
IgnoredMethods:
- dbus_interface

# assignment in method calls is used to document some params
Lint/UselessAssignment:
Enabled: false
2 changes: 1 addition & 1 deletion service/lib/dinstaller/dbus/clients/questions_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def add_generic_question(question)

def add_luks_activation_question(question)
@dbus_object.NewLuksActivation(
question.device, question.label, question.size
question.device, question.label, question.size, question.attempt
)
end
end
Expand Down
9 changes: 6 additions & 3 deletions service/lib/dinstaller/dbus/questions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,13 @@ def managed_objects
path_for(backend_q)
end

dbus_method :NewLuksActivation, "in device:s, in label:s, in size:s, out q:o" do
|device, label, size|
dbus_method :NewLuksActivation, "in device:s, in label:s, in size:s, in attempt:y, out q:o" do
|device, label, size, attempt|

backend_q = DInstaller::LuksActivationQuestion.new(
device, label: label, size: size, attempt: attempt
)

backend_q = DInstaller::LuksActivationQuestion.new(device, label: label, size: size)
backend.add(backend_q)
path_for(backend_q)
end
Expand Down
2 changes: 0 additions & 2 deletions service/lib/dinstaller/dbus/users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ def initialize(backend, logger)
FUSER_SIG = "in FullName:s, in UserName:s, in Password:s, in AutoLogin:b, in data:a{sv}"
private_constant :FUSER_SIG

# rubocop:disable Metrics/BlockLength
dbus_interface USERS_INTERFACE do
dbus_reader :root_password_set, "b"

Expand Down Expand Up @@ -109,7 +108,6 @@ def initialize(backend, logger)
0
end
end
# rubocop:enable Metrics/BlockLength

def root_ssh_key
backend.root_ssh_key
Expand Down
2 changes: 1 addition & 1 deletion service/test/dinstaller/dbus/questions_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@

it "adds a question and returns its path" do
expect(backend).to receive(:add)
expect(subject.public_send(full_method_name, "/dev/tape1", "New games", "90 minutes"))
expect(subject.public_send(full_method_name, "/dev/tape1", "New games", "90 minutes", 1))
.to start_with "/org/opensuse/DInstaller/Questions1/"
end
end
Expand Down