Skip to content

Commit

Permalink
Merge branch 'SLE-15-SP3' into merge-sle-15-sp3
Browse files Browse the repository at this point in the history
  • Loading branch information
imobachgs committed Apr 13, 2021
2 parents 2d7e2bf + fe7ea8c commit 246c8b0
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 8 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Expand Up @@ -8,7 +8,7 @@ on: [push, pull_request]
jobs:
Tests:
runs-on: ubuntu-latest
container: registry.opensuse.org/yast/head/containers/yast-ruby:latest
container: registry.opensuse.org/yast/sle-15/sp3/containers/yast-ruby:latest

steps:

Expand Down Expand Up @@ -37,7 +37,7 @@ jobs:

Rubocop:
runs-on: ubuntu-latest
container: registry.opensuse.org/yast/head/containers/yast-ruby:latest
container: registry.opensuse.org/yast/sle-15/sp3/containers/yast-ruby:latest

steps:

Expand All @@ -49,7 +49,7 @@ jobs:

Package:
runs-on: ubuntu-latest
container: registry.opensuse.org/yast/head/containers/yast-ruby:latest
container: registry.opensuse.org/yast/sle-15/sp3/containers/yast-ruby:latest

steps:

Expand All @@ -61,7 +61,7 @@ jobs:

Yardoc:
runs-on: ubuntu-latest
container: registry.opensuse.org/yast/head/containers/yast-ruby:latest
container: registry.opensuse.org/yast/sle-15/sp3/containers/yast-ruby:latest

steps:

Expand All @@ -75,7 +75,7 @@ jobs:
# checks into one job avoids that overhead
Checks:
runs-on: ubuntu-latest
container: registry.opensuse.org/yast/head/containers/yast-ruby:latest
container: registry.opensuse.org/yast/sle-15/sp3/containers/yast-ruby:latest

steps:

Expand Down
2 changes: 2 additions & 0 deletions Rakefile
@@ -1,5 +1,7 @@
require "yast/rake"

Yast::Tasks.submit_to :sle15sp3

Yast::Tasks.configuration do |conf|
# lets ignore license check for now
conf.skip_license_check << /.*/
Expand Down
6 changes: 4 additions & 2 deletions library/general/src/lib/cfa/login_defs.rb
Expand Up @@ -65,6 +65,8 @@ class LoginDefs < BaseModel
:userdel_precmd
].freeze

DEFAULT_PATH = "/etc/login.defs".freeze

class << self
# Returns the list of known attributes
#
Expand All @@ -80,7 +82,7 @@ def known_attributes
# @param file_handler [#read,#write] something able to read/write a string (like File)
# @param file_path [String] File path
# @return [LoginDefs] File with the already loaded content
def load(file_path:, file_handler: Yast::TargetFile)
def load(file_path: DEFAULT_PATH, file_handler: Yast::TargetFile)
new(file_path: file_path, file_handler: file_handler).tap(&:load)
end
end
Expand All @@ -98,7 +100,7 @@ def load(file_path:, file_handler: Yast::TargetFile)
# @param file_path [String] File path
#
# @see CFA::BaseModel#initialize
def initialize(file_path:, file_handler: Yast::TargetFile)
def initialize(file_path: DEFAULT_PATH, file_handler: Yast::TargetFile)
super(AugeasParser.new("login_defs.lns"), file_path, file_handler: file_handler)
end

Expand Down
1 change: 0 additions & 1 deletion library/general/src/modules/ShadowConfig.rb
Expand Up @@ -23,7 +23,6 @@
module Yast
# This class allows to access the API to handle login.defs attributes from Perl
#
# @see CFA::LoginDefs
# @see CFA::ShadowConfig
class ShadowConfigClass < Module
include Logger
Expand Down
18 changes: 18 additions & 0 deletions library/general/test/cfa/login_defs_test.rb
Expand Up @@ -90,4 +90,22 @@
end
end
end

describe "#present_attributes" do
it "returns the list of present attributes" do
expect(login_defs.present_attributes).to include(*ATTRS_VALUES.keys)
end
end

describe "#conflicts" do
subject(:other) { described_class.new(file_path: file_path, file_handler: file_handler) }

before do
other.encrypt_method = "SHA256"
end

it "returns the list of attributes with different values" do
expect(login_defs.conflicts(other)).to eq([:encrypt_method])
end
end
end
File renamed without changes.
6 changes: 6 additions & 0 deletions package/yast2.changes
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Apr 12 15:12:41 UTC 2021 - Imobach Gonzalez Sosa <igonzalezsosa@suse.com>

- Add a default value for file_path argument in ::new and ::load
methods of CFA::LoginDefs class.

-------------------------------------------------------------------
Mon Mar 29 09:46:31 UTC 2021 - Imobach Gonzalez Sosa <igonzalezsosa@suse.com>

Expand Down

0 comments on commit 246c8b0

Please sign in to comment.