Skip to content

Commit

Permalink
Merge ba39ac5 into f9d7252
Browse files Browse the repository at this point in the history
  • Loading branch information
ancorgs committed Mar 16, 2017
2 parents f9d7252 + ba39ac5 commit b40d211
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 3 deletions.
3 changes: 3 additions & 0 deletions library/network/src/modules/NetworkInterfaces.rb
Expand Up @@ -29,6 +29,8 @@ module Yast
# Categorizes the configurations according to type.
# Presents them one ifcfg at a time through the {#Current} hash.
class NetworkInterfacesClass < Module
include Logger

Yast.import "String"
include Logger

Expand Down Expand Up @@ -686,6 +688,7 @@ def get_devices(devregex = "[~]")
devices = SCR.Dir(path(".network.section")) || []

devices.select! { |file| file !~ /#{devregex}/ } unless devregex.nil? && devregex.empty?
devices.delete_if(&:empty?)

log.debug "devices=#{devices}"
devices
Expand Down
2 changes: 2 additions & 0 deletions library/network/test/data/etc/sysconfig/network/ifcfg-
@@ -0,0 +1,2 @@
STARTMODE="auto"
BOOTPROTO="dhcp"
7 changes: 7 additions & 0 deletions library/network/test/network_interfaces_helpers_test.rb
Expand Up @@ -115,6 +115,13 @@ module Yast
expect(subject.get_devices("")).to eql devices
end

it "does not crash with exception" do
expect { subject.get_devices }.not_to raise_error
end

it "doesn't carry empty strings" do
expect(subject.get_devices).not_to include ""
end
end

describe "#canonicalize_config" do
Expand Down
12 changes: 10 additions & 2 deletions library/system/src/modules/FileChanges.rb
Expand Up @@ -213,16 +213,24 @@ def CheckFiles(files)
ret == :ok
end

# Files that are really new
#
# @param files [Array<String>] candidate files that may be new
# @return [Array<String>]
def created_files(files)
files - @file_checksums.keys
end

# Check if any of the possibly new created files is really new
# Issue a question whether to continue if such file was manually created
# @param [Array<String>] files a list of files to check
# @return [Boolean] true if either none was changed or user agreed
# to continue

def CheckNewCreatedFiles(files)
new_files = files - @file_checksums.keys
new_files = created_files(files)

return true unless !new_files.empty?
return true if new_files.empty?

# TRANSLATORS: Continue/Cancel question, %s is a single file name or
# a comma separated list of file names.
Expand Down
15 changes: 15 additions & 0 deletions package/yast2.changes
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Mar 15 14:19:44 UTC 2017 - ancor@suse.com

- Added FileChanges.created_files (part of fix for bsc#1027582)
- 3.1.213.1

-------------------------------------------------------------------
Fri Mar 10 09:20:51 UTC 2017 - mfilka@suse.com

Expand Down Expand Up @@ -27,6 +33,15 @@ Wed Jan 18 13:56:27 UTC 2017 - jreidinger@suse.com
validation (FATE#322328)
- 3.1.210.3

-------------------------------------------------------------------
Thu Jan 5 11:35:23 UTC 2017 - mfilka@suse.com

- bnc#1017716
- do not cache ifcfg files with empty device name part (ifcfg-).
Such file cannot be mapped to any existing device and providing
empty device name could lead to unexpected crashes in other
parts of yast.

-------------------------------------------------------------------
Tue Dec 20 16:28:45 UTC 2016 - igonzalezsosa@suse.com

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


Name: yast2
Version: 3.1.210.6
Version: 3.1.213.1
Release: 0
Summary: YaST2 - Main Package
License: GPL-2.0
Expand Down

0 comments on commit b40d211

Please sign in to comment.