Skip to content

Commit

Permalink
Merge pull request #1032 from yast/remove_trailing_spaces
Browse files Browse the repository at this point in the history
Remove trailing spaces when reading interface config files (bsc#1161300)
  • Loading branch information
teclator committed Feb 5, 2020
2 parents dfa1d1b + 934da11 commit c9bd24e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
7 changes: 7 additions & 0 deletions package/yast2-network.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Tue Feb 4 19:06:52 UTC 2020 - Knut Anderssen <kanderssen@suse.com>

- Do not break when reading interface config files with trailing
spaces (bsc#1161300)
- 4.2.51

-------------------------------------------------------------------
Mon Feb 3 10:44:31 UTC 2020 - Knut Anderssen <kanderssen@suse.com>

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-network.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


Name: yast2-network
Version: 4.2.50
Version: 4.2.51
Release: 0
Summary: YaST2 - Network Configuration
License: GPL-2.0-only
Expand Down
2 changes: 1 addition & 1 deletion src/lib/y2network/sysconfig/interface_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ def defined_variables
# @return [Object] Value for the given key
def fetch_scalar(key, type)
path = Yast::Path.new(".network.value.\"#{interface}\".#{key}")
value = Yast::SCR.Read(path)
value = Yast::SCR.Read(path)&.strip
send("value_as_#{type}", value)
end

Expand Down
6 changes: 3 additions & 3 deletions test/data/scr_read/etc/sysconfig/network/ifcfg-eth0
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
BOOTPROTO='static'
BROADCAST=''
ETHTOOL_OPTIONS=''
IPADDR='192.168.123.1/24'
IPADDR='192.168.123.1/24'
MTU='1500'
NAME='Ethernet Card 0'
NETWORK=''
NAME='Ethernet Card 0'
NETWORK=''
REMOTE_IPADDR=''
STARTMODE='auto'
DHCLIENT_SET_HOSTNAME='yes'

0 comments on commit c9bd24e

Please sign in to comment.