Unified coding style and fixed simple problems in perl modules. origin
authorMaximilian Wilhelm <max@rfc2324.org>
Wed, 18 Jul 2007 22:19:03 +0000 (00:19 +0200)
committerMaximilian Wilhelm <max@rfc2324.org>
Wed, 18 Jul 2007 22:19:03 +0000 (00:19 +0200)
Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>

files/server/RBM/sshKeySync/Merge.pm
files/server/RBM/sshKeySync/Merge/Domain.pm

index 3d10553..0efad06 100644 (file)
@@ -43,10 +43,8 @@ sub _options
 {
        my %args = @_;
        
-       if ( $args{debug} )
-       {
-               foreach my $arg ( keys %args )
-               {
+       if ( $args{debug} ) {
+               foreach my $arg ( keys %args ) {
                        print STDERR ("RBM::sshKeySync::Merge->_options: $arg => $args{$arg}\n");
                }
        }
@@ -201,8 +199,7 @@ sub loadConfig {
                                # Read the value for this parameters
                                my $value = $cfg->val( $section, $param );
 
-                               if ( $param eq "base_dir" )
-                               {
+                               if ( $param eq "base_dir" ) {
                                        $config{$param} = $value;
                                        print "Setting $param = $value\n" if ( $config{debug} );
                                } else {
@@ -304,6 +301,7 @@ sub merge_domain {
                if ( $file =~ m/([[:alnum:]-]+).(\w+).key/ ) {
                        my $keyfile = "$keydir/$file";
                        my $hostname = $1;
+                       my $keytype = $2;
 
                        ##
                        # Try to open the file
@@ -317,7 +315,7 @@ sub merge_domain {
                        my $linecounter = 0;
                        my $keyline = "";
                        while ( <KEYFILE> ) {
-                               if ( $linecounter++ eq 0 ) {
+                               if ( $linecounter++ == 0 ) {
                                        $keyline = $_;
                                } 
                        } 
@@ -336,7 +334,7 @@ sub merge_domain {
                        my $ip_string = get_ip_string( "$hostname.$domain", $config );
 
                        unless ( $ip_string ) {
-                               print STDERR "Warning: No DNS entry found for host $hostname in domain $domain.\n";
+                               print STDERR "Warning: No DNS entry found for host $hostname (type $keytype) in domain $domain.\n";
                                print STDERR "Moving this key into the ATTIC...\n";
                                $self->move_key_to_ATTIC( $domain, $keyfile );
                                next;
index b228261..3f4d03f 100644 (file)
@@ -22,7 +22,7 @@ package RBM::sshKeySync::Merge::Domain;
 use strict;
 
 ##
-# new(): Create no domain object #{{{
+# new(): Create a domain object #{{{
 sub new {
        my $this = shift;
        my $class = ref($this) || $this;