Mailinglist Archive: yast-commit (2114 mails)

< Previous Next >
[yast-commit] r58644 - /trunk/network/src/lan/YaPI/NETWORK.pm
  • From: mzugec@xxxxxxxxxxxxxxxx
  • Date: Mon, 14 Sep 2009 15:29:36 -0000
  • Message-id: <E1MnDUm-00057L-9J@xxxxxxxxxxxxxxxx>
Author: mzugec
Date: Mon Sep 14 17:29:36 2009
New Revision: 58644

URL: http://svn.opensuse.org/viewcvs/yast?rev=58644&view=rev
Log:
YaPI: save hostname, save dns

Modified:
trunk/network/src/lan/YaPI/NETWORK.pm

Modified: trunk/network/src/lan/YaPI/NETWORK.pm
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/network/src/lan/YaPI/NETWORK.pm?rev=58644&r1=58643&r2=58644&view=diff
==============================================================================
--- trunk/network/src/lan/YaPI/NETWORK.pm (original)
+++ trunk/network/src/lan/YaPI/NETWORK.pm Mon Sep 14 17:29:36 2009
@@ -43,12 +43,13 @@
}
}

+ #FIXME: validate for nil values (dns espacially)
my %ret = ('interfaces'=>\%interfaces,
'routes'=>{'default'=>{'via'=>Routing->GetGateway()}},
- 'dns'=>{'dnsservers'=>\@{DNS->nameservers},
'dnsdomains'=>\@{DNS->searchlist}},
+ 'dns'=>{'nameservers'=>\@{DNS->nameservers},
'searches'=>\@{DNS->searchlist}},
'hostname'=>{'name'=>DNS->hostname, 'domain'=>DNS->domain}
);
-
+y2internal("Network_YaPI->Read() ", Dumper(\%ret));
return \%ret;
}

@@ -59,6 +60,7 @@
my $self = shift;
my $args = shift;
y2milestone("YaPI->Write with settings:", Dumper(\$args));
+ # SAVE DEFAULT ROUTE
if (exists($args->{'route'})){
my $gw="";
my $dest="";
@@ -80,6 +82,24 @@
y2milestone("YaPI->Write after change Routes:", Dumper(Routing->Routes));
Routing->Write();
}
+ # SAVE HOSTNAME
+ if (exists($args->{'hostname'})){
+ y2internal("hostname", Dumper(\$args->{'hostname'}));
+ DNS->Read();
+ DNS->hostname($args->{'hostname'}->{'name'});
+ DNS->domain($args->{'hostname'}->{'domain'});
+ DNS->modified(1);
+ DNS->Write();
+ }
+ # SAVE DNS Settings
+ if (exists($args->{'dns'})){
+ y2internal("dns", Dumper(\$args->{'dns'}));
+ DNS->Read();
+ DNS->nameservers($args->{'dns'}->{'nameservers'});
+ DNS->searchlist($args->{'dns'}->{'searches'});
+ DNS->modified(1);
+ DNS->Write();
+ }

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