Skip to content

Commit

Permalink
YaPI: drop caches when reading network interfaces
Browse files Browse the repository at this point in the history
make it stateless (bnc#790219#c33)

Conflicts:

	package/yast2-network.changes

Conflicts:
	package/yast2-network.changes
  • Loading branch information
Ladislav Slezak authored and mchf committed Apr 9, 2013
1 parent 9898809 commit 12b4a5b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions package/yast2-network.changes
Expand Up @@ -7,6 +7,8 @@ Fri Mar 22 10:08:35 UTC 2013 - mfilka@suse.com
- bnc#790219
- fixed writting ifcfg for bonding through YaPI.
More than two interfaces can be added into bond device.
- YaPI: drop caches when reading network interfaces, make it
stateless (bnc#790219#c33) - lslezak@suse.cz
- 2.24.17

-------------------------------------------------------------------
Expand Down
8 changes: 6 additions & 2 deletions src/lan/YaPI/NETWORK.pm
Expand Up @@ -11,6 +11,7 @@ YaST::YCP::Import ("Hostname");
YaST::YCP::Import ("Host");
YaST::YCP::Import ("DNS");
YaST::YCP::Import ("Routing");
YaST::YCP::Import ("NetworkInterfaces");
# -------------------------------------

our $VERSION = '1.0.0';
Expand All @@ -26,6 +27,9 @@ sub Read {

DNS->Read();
Routing->Read();
# force cleaning the cache to make it stateless
# NetworkInterfaces are read in LanItems
NetworkInterfaces->CleanCacheRead();
LanItems->Read();

my %interfaces = ();
Expand Down Expand Up @@ -174,8 +178,8 @@ sub writeInterfaces {
y2milestone("interface", Dumper(\$args->{'interface'}));

while (my ($dev, $ifc) = each %{$args->{'interface'}}) {
YaST::YCP::Import ("NetworkInterfaces");
NetworkInterfaces->Read();
# force cleaning the cache to make it stateless
NetworkInterfaces->CleanCacheRead();
NetworkInterfaces->Add() unless NetworkInterfaces->Edit($dev);
NetworkInterfaces->Name($dev);

Expand Down

0 comments on commit 12b4a5b

Please sign in to comment.