Skip to content

Commit

Permalink
Update openSUSE-13_2 to version 3.1.114 (from master)
Browse files Browse the repository at this point in the history
* commit '1a6ec70': (48 commits)
  Small code improvement in LanUdevAuto#Write
  Fixed error logging - do not write false positives.
  Fixed log message
  Cleanup in old rspec test
  Convert specs to RSpec 2.14.8 syntax with Transpec
  Several minor fixes
  Fixed changelog
  Updated changelog
  Initialize configuraton name in Hardware tab correctly. bnc#910337
  Updated changelog
  Dropped some builtins from LanItems#Commit
  Do not detect device type when adding new device. bnc#912904
  Fixed updating udev rules in case of virtual devices. bnc#914833
  Updated testsuite to cover bnc#914833
  Replaced @Items in SetItemName to make things better testeable
  Fixed typo in CONTRIBUTING.md
  update contribution to point to bugzilla.suse.com (bnc#924427)
  Fixed string formatting in log message
  Fixed changelog
  Consolidated LanUdevAuto rspec tests.
  ...
  • Loading branch information
imobachgs committed Sep 15, 2015
2 parents a5b6819 + 1a6ec70 commit c977ac3
Show file tree
Hide file tree
Showing 28 changed files with 349 additions and 262 deletions.
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Expand Up @@ -12,13 +12,13 @@ Bug Reports
-----------

If you find a problem, please report it either using
[Bugzilla](https://bugzilla.novell.com/enter_bug.cgi?format=guided&product=openSUSE+Factory&component=YaST2)
[Bugzilla](https://bugzilla.suse.com/enter_bug.cgi?format=guided&product=openSUSE+Factory&component=YaST2)
or [GitHub issues](../../issues). (For Bugzilla, use the [simplified
registration](https://secure-www.novell.com/selfreg/jsp/createSimpleAccount.jsp)
if you don't have an account yet.)

If you find a problem, please report it either using
[Bugzilla](https://bugzilla.novell.com/) or GitHub issues. We can't guarantee
[Bugzilla](https://bugzilla.suse.com/) or GitHub issues. We can't guarantee
that every bug will be fixed, but we'll try.

When creating a bug report, please follow our [bug reporting
Expand Down Expand Up @@ -71,7 +71,7 @@ functional changes into one commit. When writing commit messages, adhere to
[widely used
conventions](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).

If your commit is related to a bug in Buzgilla or an issue on GitHub, make sure
If your commit is related to a bug in Bugzilla or an issue on GitHub, make sure
you mention it in the commit message for cross-reference. Use format like
bnc#775814 or gh#yast/yast-foo#42. See also [GitHub
autolinking](https://help.github.com/articles/github-flavored-markdown#references)
Expand Down
37 changes: 37 additions & 0 deletions package/yast2-network.changes
@@ -1,3 +1,40 @@
-------------------------------------------------------------------
Mon Apr 27 07:06:18 UTC 2015 - mfilka@suse.com

- bnc#912904
- do not crash when adding new device and proposed configuration
name is changed to new one
- bnc#914833
- do not crash when renaming virtual device via hardware tab
- bnc#910337
- initialize configuration name in Hardware tab correctly. It
means according device type. Also uses custom name if user
used nonstandard one.
- bnc#905738
- udev rules provided by AutoYaST profile gets applied
- bnc#918356
- populate bond slave candidates list with proper device names
- 3.1.114

-------------------------------------------------------------------
Wed Jan 28 13:12:16 UTC 2015 - lslezak@suse.cz

- fixed a build failure when building against the latest yast2
package
- 3.1.113

-------------------------------------------------------------------
Tue Dec 23 10:52:11 UTC 2014 - mvidner@suse.com

- Removed a bash specific post script with a workaround
for an ancient bug (bnc#39842).
- 3.1.112

-------------------------------------------------------------------
Thu Dec 4 09:50:29 UTC 2014 - jreidinger@suse.com

- remove X-KDE-Library from desktop file (bnc#899104)

-------------------------------------------------------------------
Fri Nov 28 08:51:22 UTC 2014 - mfilka@suse.com

Expand Down
13 changes: 1 addition & 12 deletions package/yast2-network.spec
Expand Up @@ -17,7 +17,7 @@


Name: yast2-network
Version: 3.1.110
Version: 3.1.114
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand Down Expand Up @@ -89,17 +89,6 @@ This package contains autogenerated documentation for yast2-network
/bin/rm -f $RPM_BUILD_ROOT/%{yast_desktopdir}/network.desktop
/bin/rm -f $RPM_BUILD_ROOT/%{yast_desktopdir}/provider.desktop


%post -p /bin/bash
# This fixes the files that were touched when #24842 was in effect.
# #42990: shut up when no wlan files are there.
shopt -s nullglob
files=`echo /etc/sysconfig/network/ifcfg-wlan*`
if [ -n "$files" ]; then
/bin/chown root:root $files
/bin/chmod 0600 $files
fi

%files
%defattr(-,root,root)
%{yast_ybindir}/*
Expand Down
17 changes: 12 additions & 5 deletions src/clients/lan_auto.rb
Expand Up @@ -47,7 +47,6 @@ def main
Yast.include self, "network/lan/wizards.rb"
Yast.include self, "network/routines.rb"

@ret = nil
@func = ""
@param = {}

Expand Down Expand Up @@ -82,6 +81,7 @@ def main
@func = "Import"
end

Builtins.y2milestone("Lan autoinst callback: #{@func}")

if @func == "Summary"
@ret = Ops.get_string(Lan.Summary("summary"), 0, "")
Expand Down Expand Up @@ -141,6 +141,7 @@ def main
end
@new = FromAY(@param)
Lan.Import(@new)
LanUdevAuto.Import(@new)
@ret = true
elsif @func == "Read"
@progress_orig = Progress.set(false)
Expand All @@ -159,7 +160,15 @@ def main
@ret = deep_copy(@autoyast)
elsif @func == "Write"
@progress_orig = Progress.set(false)
@ret = Lan.WriteOnly

result = LanUdevAuto.Write
Builtins.y2error("Writing udev rules failed") if !result
@ret = result

result = Lan.WriteOnly
Builtins.y2error("Writing lan config failed") if !result
@ret = @ret && result

if Ops.get(LanItems.autoinstall_settings, "strict_IP_check_timeout") != nil
if Lan.isAnyInterfaceDown
@timeout = Ops.get_integer(
Expand All @@ -182,10 +191,8 @@ def main
@ret = false
end

Builtins.y2debug("ret=%1", @ret)
Builtins.y2milestone("Lan auto finished")
Builtins.y2milestone("Lan auto finished (#{@ret})")
Builtins.y2milestone("----------------------------------------")
deep_copy(@ret)

# EOF
end
Expand Down
2 changes: 0 additions & 2 deletions src/clients/save_network.rb
Expand Up @@ -250,8 +250,6 @@ def configure_target
NetworkAutoconfiguration.instance.configure_dns
NetworkAutoconfiguration.instance.configure_hosts

LanUdevAuto.Write if Mode.autoinst

DNS.create_hostname_link

SCR.Execute(path(".target.bash"), "chkconfig network on")
Expand Down
1 change: 0 additions & 1 deletion src/config/old-desktops/dns.desktop
Expand Up @@ -4,7 +4,6 @@ Categories=Settings;System;Qt;X-SuSE-YaST;X-SuSE-YaST-Net_advanced;

X-KDE-ModuleType=Library
X-KDE-HasReadOnlyMode=true
X-KDE-Library=yast2
X-SuSE-YaST-Call=dns

X-SuSE-YaST-Group=Net_advanced
Expand Down
1 change: 0 additions & 1 deletion src/config/old-desktops/routing.desktop
Expand Up @@ -4,7 +4,6 @@ Categories=Settings;System;Qt;X-SuSE-YaST;X-SuSE-YaST-Net_advanced;

X-KDE-ModuleType=Library
X-KDE-HasReadOnlyMode=true
X-KDE-Library=yast2
X-SuSE-YaST-Call=routing

X-SuSE-YaST-Group=Net_advanced
Expand Down
1 change: 0 additions & 1 deletion src/desktop/host.desktop
Expand Up @@ -4,7 +4,6 @@ Categories=Settings;System;Qt;X-SuSE-YaST;X-SuSE-YaST-Net_advanced;

X-KDE-ModuleType=Library
X-KDE-HasReadOnlyMode=true
X-KDE-Library=yast2
X-SuSE-YaST-Call=host

X-SuSE-YaST-Group=Net_advanced
Expand Down
1 change: 0 additions & 1 deletion src/desktop/lan.desktop
Expand Up @@ -4,7 +4,6 @@ Categories=Settings;System;Qt;X-SuSE-YaST;X-SuSE-YaST-Network;

X-KDE-ModuleType=Library
X-KDE-HasReadOnlyMode=true
X-KDE-Library=yast2
X-SuSE-YaST-Call=lan

X-SuSE-YaST-Group=Network
Expand Down
1 change: 0 additions & 1 deletion src/desktop/network.desktop
Expand Up @@ -4,7 +4,6 @@ Categories=Settings;System;Qt;X-SuSE-YaST;X-SuSE-YaST-Net_advanced;

X-KDE-ModuleType=Library
X-KDE-HasReadOnlyMode=true
X-KDE-Library=yast2
X-SuSE-YaST-Call=network

X-SuSE-YaST-Group=Net_advanced
Expand Down
1 change: 0 additions & 1 deletion src/desktop/remote.desktop
Expand Up @@ -4,7 +4,6 @@ Categories=Settings;System;Qt;X-SuSE-YaST;X-SuSE-YaST-Net_advanced;

X-KDE-ModuleType=Library
X-KDE-HasReadOnlyMode=true
X-KDE-Library=yast2
X-SuSE-YaST-Call=remote

X-SuSE-YaST-Group=Net_advanced
Expand Down
4 changes: 0 additions & 4 deletions src/include/network/lan/address.rb
Expand Up @@ -1536,10 +1536,6 @@ def AddressDialog
# address tab
if LanItems.operation == :add
LanItems.device = NetworkInterfaces.device_num(ifcfgname)
LanItems.type = NetworkInterfaces.GetTypeFromIfcfg(@settings)
if LanItems.type == nil
LanItems.type = NetworkInterfaces.device_type(ifcfgname)
end
end

LanItems.bootproto = Ops.get_string(@settings, "BOOTPROTO", "")
Expand Down
1 change: 1 addition & 0 deletions src/include/network/lan/hardware.rb
Expand Up @@ -834,6 +834,7 @@ def storeHW(key, event)
if isNewDevice
nm = devname_from_hw_dialog
LanItems.type = UI.QueryWidget(Id(:type), :Value)
LanItems.device = nm

NetworkInterfaces.Name = nm
Ops.set(LanItems.Items, [LanItems.current, "ifcfg"], nm)
Expand Down
25 changes: 25 additions & 0 deletions src/include/network/lan/udev.rb
Expand Up @@ -45,6 +45,31 @@ def update_udev_rule_key(rule, key, value)
rule
end

# Writes new persistent udev net rules and tells udevd to update its configuration
def write_update_udevd(udev_rules)
SCR.Write(path(".udev_persistent.rules"), udev_rules)
SCR.Write(path(".udev_persistent.nil"), [])

update_udevd
end

# Tells udevd to reload and update its configuration
#
# @return [boolean] false when new configuration cannot be activated
def update_udevd
SCR.Execute(path(".target.bash"), "udevadm control --reload")

# When configuring a new s390 card, we neglect to fill
# its Items[i, "udev", "net"], causing jumbled names (bnc#721520)
# The udev trigger will make udev write the persistent names
# (which it already has done, but we have overwritten them now).
ret = SCR.Execute(
path(".target.bash"),
"udevadm trigger --subsystem-match=net --action=add"
)
ret == 0
end

# Removes (key,operator,value) tripplet from given udev rule.
def RemoveKeyFromUdevRule(rule, key)
rule = deep_copy(rule)
Expand Down
26 changes: 19 additions & 7 deletions src/include/network/routines.rb
Expand Up @@ -928,23 +928,35 @@ def GetAllInterfaces
end

def SetLinkUp(dev_name)
log.info("Setting link up for interface #{dev_name}")
Run("ip link set #{dev_name} up")
end

def SetLinkDown(dev_name)
log.info("Setting link down for interface #{dev_name}")
Run("ip link set #{dev_name} down")
end

# Tries to set all available interfaces up
#
# @return [boolean] false if some of interfaces cannot be set up
def SetAllLinksUp
interfaces = GetAllInterfaces()
ret = !interfaces.empty?

interfaces.each do |ifc|
Builtins.y2milestone("Setting link up for interface %1", ifc)
ret = SetLinkUp(ifc) && ret
end
return false if interfaces.empty?

ret
interfaces.all? { |i| SetLinkUp(i) }
end

# Tries to set all available interfaces down
#
# @return [boolean] false if some of interfaces cannot be set down
def SetAllLinksDown
interfaces = GetAllInterfaces()

return false if interfaces.empty?

interfaces.all? { |i| SetLinkDown(i) }
end

# Checks if given device has carrier
Expand Down Expand Up @@ -1093,7 +1105,7 @@ def confirmed_detection(hwtype)
}

hwstring = hwstrings[hwtype] || _("All Network Devices")
Confirm.Detection(hwstring, "yast-lan")
Confirm.Detection(hwstring, nil)
end
end
end
48 changes: 25 additions & 23 deletions src/include/network/widgets.rb
Expand Up @@ -559,46 +559,48 @@ def handleDevice(items, selected)
# @param [Array<Fixnum>] itemIds list of indexes into LanItems::Items
# @param [Array<String>] enslavedIfaces list of device names of already enslaved devices
def CreateSlaveItems(itemIds, enslavedIfaces)
itemIds = deep_copy(itemIds)
enslavedIfaces = deep_copy(enslavedIfaces)
raise ArgumentError, "no slave device defined" if itemIds.nil?

items = []

Builtins.foreach(itemIds) do |itemId|
description = ""
itemIds.each do |itemId|
dev_name = LanItems.GetDeviceName(itemId)
ifcfg = LanItems.GetDeviceMap(itemId)
next if IsEmpty(dev_name)
ifcfg = { "dev_name" => dev_name } if ifcfg == nil

next if dev_name.nil? || dev_name.empty?

dev_type = LanItems.GetDeviceType(itemId)
if Builtins.contains(["tun", "tap"], dev_type)

if ["tun", "tap"].include? dev_type
description = NetworkInterfaces.GetDevTypeDescription(dev_type, true)
else
ifcfg = LanItems.GetDeviceMap(itemId) || {}

description = BuildDescription(
"",
"",
dev_type,
dev_name,
ifcfg,
[Ops.get_map(LanItems.GetLanItem(itemId), "hwinfo", {})]
[LanItems.GetLanItem(itemId)["hwinfo"] || {}]
)

# this conditions origin from bridge configuration
# if enslaving a configured device then its configuration is rewritten
# to "0.0.0.0/32"
if Ops.get_string(ifcfg, "IPADDR", "") != "0.0.0.0"
description = Builtins.sformat("%1 (%2)", description, "configured")
end
#
# translators: a note that listed device is already configured
description += " " + _("configured") if ifcfg["IPADDR"] != "0.0.0.0"
end
selected = Builtins.contains(enslavedIfaces, dev_name)
items = Builtins.add(
items,
Item(
Id(dev_name),
Builtins.sformat("%1 - %2", dev_name, description),
selected
)

selected = false
selected = enslavedIfaces.include?(dev_name) if enslavedIfaces

items << Item(
Id(dev_name),
"#{dev_name} - #{description}",
selected
)
end

deep_copy(items)
items
end
end
end

0 comments on commit c977ac3

Please sign in to comment.