Skip to content

Commit

Permalink
Merge pull request #163 from mchf/exclude-configured
Browse files Browse the repository at this point in the history
Exclude configured devices
  • Loading branch information
mchf committed Feb 28, 2014
2 parents a574d78 + 11e6af3 commit 35ae52c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
9 changes: 9 additions & 0 deletions package/yast2-network.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
-------------------------------------------------------------------
Fri Feb 28 11:21:19 UTC 2014 - mfilka@suse.com

- bnc#864614
- exclude already configured devices from dhcp candidates when
attempting to do an autoconfiguration at the begining of
installation
- 3.1.28

-------------------------------------------------------------------
Fri Feb 28 08:25:53 UTC 2014 - mfilka@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: 3.1.27
Version: 3.1.28
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand Down
14 changes: 13 additions & 1 deletion src/clients/inst_setup_dhcp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,21 @@ def self.write_configuration
NetworkInterfaces.Write("")
end

def self.configured?(devname)
# TODO:
# one day there should be LanItems.IsItemConfigured, but we currently
# miss index -> devname translation. As this LanItems internal structure
# will be subject of refactoring, we will use NetworkInterfaces directly.
# It currently doesn't hurt as it currently writes configuration for both
# wicked even sysconfig.
NetworkInterfaces.Check(devname)
end

include Logger

# TODO time consuming, some progress would be nice
dhcp_cards = network_cards.select { |c| get_lease?(c) }
dhcp_cards = network_cards.select { |c| !configured?(c) && get_lease?(c) }
log.info "Candidates for enabling DHCP: #{dhcp_cards}"

dhcp_cards.each do |dcard|
setup_dhcp(dcard) # make DHCP setup persistent
Expand Down

0 comments on commit 35ae52c

Please sign in to comment.