[yast-commit] r67410 - in /branches/SuSE-Code-11-SP2-Branch/dns-server: package/yast2-dns-server.changes src/DnsServer.pm
Author: locilka Date: Fri Feb 10 14:57:05 2012 New Revision: 67410 URL: http://svn.opensuse.org/viewcvs/yast?rev=67410&view=rev Log: - Fixed saving the current status of all zones to LDAP/files while switching from using files to LDAP and vice versa (bnc#746401). Modified: branches/SuSE-Code-11-SP2-Branch/dns-server/package/yast2-dns-server.changes branches/SuSE-Code-11-SP2-Branch/dns-server/src/DnsServer.pm Modified: branches/SuSE-Code-11-SP2-Branch/dns-server/package/yast2-dns-server.changes URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/dns-server/package/yast2-dns-server.changes?rev=67410&r1=67409&r2=67410&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/dns-server/package/yast2-dns-server.changes (original) +++ branches/SuSE-Code-11-SP2-Branch/dns-server/package/yast2-dns-server.changes Fri Feb 10 14:57:05 2012 @@ -3,6 +3,8 @@ - Fixed transforming records from absolute to relative format while they are listed in UI (bnc#746363). +- Fixed saving the current status of all zones to LDAP/files while + switching from using files to LDAP and vice versa (bnc#746401). ------------------------------------------------------------------ Thu Feb 9 15:16:58 CET 2012 - locilka@suse.com Modified: branches/SuSE-Code-11-SP2-Branch/dns-server/src/DnsServer.pm URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/dns-server/src/DnsServer.pm?rev=67410&r1=67409&r2=67410&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/dns-server/src/DnsServer.pm (original) +++ branches/SuSE-Code-11-SP2-Branch/dns-server/src/DnsServer.pm Fri Feb 10 14:57:05 2012 @@ -120,15 +120,21 @@ return 0; } - if (! ($zone_map{"modified"} || $save_all)) + if ($zone_name eq "localhost" || $zone_name eq "0.0.127.in-addr.arpa") { - y2milestone ("Skipping zone $zone_name, wasn't modified"); + y2milestone ("Skipping system zone $zone_name"); return 1; } - if ($zone_name eq "localhost" || $zone_name eq "0.0.127.in-addr.arpa") + if ($save_all) { + y2milestone ("Saving all zones, flagging ".$zone_name." zone as modified"); + $zone_map{"modified"} = 1; + } + + # zone not modified (it's not modified if the flag is not set) + if (! (defined $zone_map{"modified"} ? $zone_map{"modified"} : 0)) { - y2milestone ("Skipping system zone $zone_name"); + y2milestone ("Skipping zone $zone_name, wasn't modified"); return 1; } @@ -645,12 +651,20 @@ return $start_service; } +sub UseLdapModified { + my $self = shift; + + $self->SetModified (); + # Save all zones as they are into the new config location (LDAP/files) + $save_all = 1; +} + BEGIN { $TYPEINFO{SetUseLdap} = [ "function", "boolean", "boolean" ];} sub SetUseLdap { my $self = shift; - $use_ldap = shift; + my $new_use_ldap = shift; - if ($use_ldap) { + if ($new_use_ldap) { # trying init LDAP if use_ldap selected my $success = $self->LdapInit (1, 1); @@ -659,9 +673,10 @@ } } - $self->SetModified (); + $use_ldap = $new_use_ldap; + y2milestone ("Using LDAP set to: ".$use_ldap); - $save_all = 1; + $self->UseLdapModified(); return 1; } @@ -1674,7 +1689,8 @@ if ($ask_user_to_enable_ldap) { # yes-no popup $use_ldap = Popup->YesNo (__("Enable LDAP support?")); - y2milestone ("User choose to use LDAP: $use_ldap"); + $self->UseLdapModified(); + y2milestone ("User chose to use LDAP: $use_ldap"); # just disable LDAP } else { $use_ldap = 0; -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
locilka@svn2.opensuse.org