Skip to content

Commit

Permalink
Merge branch 'SLE-12-SP2' into master-fix-aliased-resources-merge
Browse files Browse the repository at this point in the history
* SLE-12-SP2:
  Bump version and update changes file
  Don't add garbage when aliased resource configuration is missing
  • Loading branch information
imobachgs committed Nov 18, 2016
2 parents 6eee972 + 53c8d6e commit a617a2c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
7 changes: 7 additions & 0 deletions package/autoyast2.changes
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Fri Nov 18 10:00:25 UTC 2016 - igonzalezsosa@suse.com

- Do not crash when services manager configuration is missing
(related to bsc#887115)
- 3.2.3

-------------------------------------------------------------------
Wed Nov 16 14:45:24 UTC 2016 - igonzalezsosa@suse.com

Expand Down
2 changes: 1 addition & 1 deletion package/autoyast2.spec
Expand Up @@ -17,7 +17,7 @@


Name: autoyast2
Version: 3.2.2
Version: 3.2.3
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand Down
2 changes: 1 addition & 1 deletion src/modules/Profile.rb
Expand Up @@ -925,7 +925,7 @@ def add_autoyast_packages
def merge_resource_aliases!
resource_aliases_map.each do |alias_name, resource_name|
aliased_config = current.delete(alias_name)
next if current.has_key?(resource_name)
next if aliased_config.nil? || current.has_key?(resource_name)
current[resource_name] = aliased_config
end
end
Expand Down
10 changes: 10 additions & 0 deletions test/profile_test.rb
Expand Up @@ -221,6 +221,16 @@ def patterns_list
end
end

context "and no configuration is present" do
let(:profile) { {} }

it "does not set any configuration for the resource" do
Yast::Profile.Import(profile)
expect(Yast::Profile.current.keys).to_not include("old_custom")
expect(Yast::Profile.current.keys).to_not include("custom")
end
end

context "and resource has also an alternate name" do
let(:profile) { { "old_custom" => { "dummy" => true } } }
let(:custom_module) do
Expand Down

0 comments on commit a617a2c

Please sign in to comment.