Mailinglist Archive: yast-commit (2114 mails)

< Previous Next >
[yast-commit] r58666 - in /trunk/network: VERSION package/yast2-network.changes src/lan/YaPI/NETWORK.pm
  • From: mzugec@xxxxxxxxxxxxxxxx
  • Date: Wed, 16 Sep 2009 12:54:13 -0000
  • Message-id: <E1Mnu1V-0001bb-5s@xxxxxxxxxxxxxxxx>
Author: mzugec
Date: Wed Sep 16 14:54:12 2009
New Revision: 58666

URL: http://svn.opensuse.org/viewcvs/yast?rev=58666&view=rev
Log:
YaPI: write interfaces

Modified:
trunk/network/VERSION
trunk/network/package/yast2-network.changes
trunk/network/src/lan/YaPI/NETWORK.pm

Modified: trunk/network/VERSION
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/network/VERSION?rev=58666&r1=58665&r2=58666&view=diff
==============================================================================
--- trunk/network/VERSION (original)
+++ trunk/network/VERSION Wed Sep 16 14:54:12 2009
@@ -1 +1 @@
-2.18.46
+2.18.47

Modified: trunk/network/package/yast2-network.changes
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/network/package/yast2-network.changes?rev=58666&r1=58665&r2=58666&view=diff
==============================================================================
--- trunk/network/package/yast2-network.changes (original)
+++ trunk/network/package/yast2-network.changes Wed Sep 16 14:54:12 2009
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Wed Sep 16 14:53:15 CEST 2009 - mzugec@xxxxxxx
+
+- YaPI: write all values (included interfaces)
+- 2.18.47
+
+-------------------------------------------------------------------
Fri Sep 11 15:31:27 CEST 2009 - mzugec@xxxxxxx

- YaPI: possible to remove default GW (bnc#538397)

Modified: trunk/network/src/lan/YaPI/NETWORK.pm
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/network/src/lan/YaPI/NETWORK.pm?rev=58666&r1=58665&r2=58666&view=diff
==============================================================================
--- trunk/network/src/lan/YaPI/NETWORK.pm (original)
+++ trunk/network/src/lan/YaPI/NETWORK.pm Wed Sep 16 14:54:12 2009
@@ -8,6 +8,7 @@

# ------------------- imported modules
YaST::YCP::Import ("LanItems");
+YaST::YCP::Import ("Hostname");
YaST::YCP::Import ("DNS");
YaST::YCP::Import ("Routing");
# -------------------------------------
@@ -23,6 +24,7 @@
sub Read {
my $self = shift;

+# Hostname->Read();
DNS->Read();
Routing->Read();
LanItems->Read();
@@ -47,9 +49,8 @@
my %ret = ('interfaces'=>\%interfaces,
'routes'=>{'default'=>{'via'=>Routing->GetGateway()}},
'dns'=>{'nameservers'=>\@{DNS->nameservers},
'searches'=>\@{DNS->searchlist}},
- 'hostname'=>{'name'=>DNS->hostname, 'domain'=>DNS->domain}
+ 'hostname'=>{'name'=>Hostname->CurrentHostname,
'domain'=>Hostname->CurrentDomain}
);
-y2internal("Network_YaPI->Read() ", Dumper(\%ret));
return \%ret;
}

@@ -84,7 +85,7 @@
}
# SAVE HOSTNAME
if (exists($args->{'hostname'})){
- y2internal("hostname", Dumper(\$args->{'hostname'}));
+ y2milestone("hostname", Dumper(\$args->{'hostname'}));
DNS->Read();
DNS->hostname($args->{'hostname'}->{'name'});
DNS->domain($args->{'hostname'}->{'domain'});
@@ -93,13 +94,41 @@
}
# SAVE DNS Settings
if (exists($args->{'dns'})){
- y2internal("dns", Dumper(\$args->{'dns'}));
+ y2milestone("dns", Dumper(\$args->{'dns'}));
DNS->Read();
DNS->nameservers($args->{'dns'}->{'nameservers'});
DNS->searchlist($args->{'dns'}->{'searches'});
DNS->modified(1);
DNS->Write();
}
+ # SAVE DNS Settings
+ if (exists($args->{'interface'})){
+ y2milestone("interface", Dumper(\$args->{'interface'}));
+ foreach my $dev (keys %{$args->{'interface'}}){
+# YaST::YCP::Import ("LanItems");
+# LanItems->Read();
+# foreach my $iface (keys %{LanItems->Items}){
+# LanItems->current($iface);
+# LanItems->DeleteItem();
+# }
+# LanItems->Write();
+ YaST::YCP::Import ("NetworkInterfaces");
+ NetworkInterfaces->Read();
+ NetworkInterfaces->Add() if NetworkInterfaces->Edit($dev) ne 1;
+ NetworkInterfaces->Name($dev);
+ my %config=("STARTMODE" => "onboot",
+ "BOOTPROTO" =>
$args->{'interface'}->{$dev}->{'bootproto'},
+ "IPADDR" => $args->{'interface'}->{$dev}->{'ipaddr'}
+ );
+ NetworkInterfaces->Current(\%config);
+ NetworkInterfaces->Commit();
+ NetworkInterfaces->Write("");
+ YaST::YCP::Import ("Service");
+ Service->Restart("network");
+ # rcnetwork restart
+ }
+
+ }

return 1;
}

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages