[pve-devel] r5480 - in pve-cluster/trunk/data: perl src

svn-commits at proxmox.com svn-commits at proxmox.com
Wed Feb 2 13:33:06 CET 2011


Author: dietmar
Date: 2011-02-02 13:33:06 +0100 (Wed, 02 Feb 2011)
New Revision: 5480

Modified:
   pve-cluster/trunk/data/perl/Cluster.pm
   pve-cluster/trunk/data/src/logger.c
Log:
fix parse error, remove trailing whitespaces


Modified: pve-cluster/trunk/data/perl/Cluster.pm
===================================================================
--- pve-cluster/trunk/data/perl/Cluster.pm	2011-02-02 12:03:44 UTC (rev 5479)
+++ pve-cluster/trunk/data/perl/Cluster.pm	2011-02-02 12:33:06 UTC (rev 5480)
@@ -3,7 +3,7 @@
 use strict;
 use POSIX;
 use Socket;
-use Storable qw(dclone);            
+use Storable qw(dclone);
 use IO::File;
 use PVE::Tools qw(run_command);
 use PVE::INotify;
@@ -14,9 +14,9 @@
 use base 'Exporter';
 
 our @EXPORT_OK = qw(
-cfs_read_file 
-cfs_write_file 
-cfs_register_file 
+cfs_read_file
+cfs_write_file
+cfs_register_file
 cfs_lock_file);
 
 use Data::Dumper; # fixme: remove
@@ -78,7 +78,7 @@
     check_cfs_is_mounted();
 
     mkdir $authdir || die "unable to create dir '$authdir' - $!\n";
- 
+
     my $cmd = "openssl genrsa -out '$authprivkeyfn' 2048";
     run_command($cmd);
 
@@ -87,7 +87,7 @@
 }
 
 sub gen_pveca_key {
-    
+
     return if -f $pveca_key_fn;
 
     eval {
@@ -98,7 +98,7 @@
 }
 
 sub gen_pveca_cert {
-    
+
     if (-f $pveca_key_fn && -f $pveca_cert_fn) {
 	return 0;
     }
@@ -111,8 +111,8 @@
 
     eval {
 	run_command(['openssl', 'req', '-batch', '-days', '3650', '-new',
-		     '-x509', '-nodes', '-key', 
-		     $pveca_key_fn, '-out', $pveca_cert_fn, '-subj', 
+		     '-x509', '-nodes', '-key',
+		     $pveca_key_fn, '-out', $pveca_cert_fn, '-subj',
 		     "/CN=Proxmox Virtual Environment/OU=$nid/O=PVE Cluster Manager CA/"]);
     };
 
@@ -122,13 +122,13 @@
 }
 
 sub gen_pve_ssl_key {
-    
+
     return if -f $pvessl_key_fn;
 
     eval {
 	run_command(['openssl', 'genrsa', '-out', $pvessl_key_fn, '2048']);
     };
-     
+
     die "unable to generate pve ssl key:\n$@" if $@;
 }
 
@@ -166,7 +166,7 @@
     my $sslconf = <<__EOD;
 RANDFILE = /root/.rnd
 extensions = v3_req
- 
+
 [ req ]
 default_bits = 2048
 distinguished_name = req_distinguished_name
@@ -208,9 +208,9 @@
     update_serial("0000000000000000") if ! -f $pveca_srl_fn;
 
     eval {
-	run_command(['openssl', 'x509', '-req', '-in', $reqfn, '-days', '3650', 
+	run_command(['openssl', 'x509', '-req', '-in', $reqfn, '-days', '3650',
 		     '-out', $pvessl_cert_fn, '-CAkey', $pveca_key_fn,
-		     '-CA', $pveca_cert_fn, '-CAserial', $pveca_srl_fn, 
+		     '-CA', $pveca_cert_fn, '-CAserial', $pveca_srl_fn,
 		     '-extfile', $cfgfn]);
     };
 
@@ -233,17 +233,17 @@
     my ($msgid, $data) = @_;
 
     my $res = PVE::IPCC::ipcc_send_rec($msgid, $data);
-    
+
     die "ipcc_send_rec failed: $!\n" if !defined($res);
 
     return $res;
 };
- 
+
 my $ipcc_send_rec_json = sub {
     my ($msgid, $data) = @_;
 
     my $res = PVE::IPCC::ipcc_send_rec($msgid, $data);
-    
+
     die "ipcc_send_rec failed: $!\n" if !defined($res);
 
     return decode_json($res);
@@ -341,7 +341,7 @@
 	if (!$vmlist->{version} || $vmlist->{version} != $versions->{vmlist}) {
 	    #warn "detected new vmlist1\n";
 	    $vmlist = &$ipcc_send_rec_json(3);
-	} 
+	}
     };
     $err = $@;
     if ($err) {
@@ -386,7 +386,7 @@
     eval {
 	&$ipcc_update_status("vminfo", $data);
     };
-   
+
     warn $@ if $@;
 }
 
@@ -423,7 +423,7 @@
     $observed->{$filename} || die "unknown file '$filename'";
 
     die "file '$filename' already registered" if $file_info->{$filename};
-    
+
     $file_info->{$filename} = {
 	parser => $parser,
 	writer => $writer,
@@ -466,7 +466,7 @@
 	$version = $versions->{$filename};
     }
 
-    my $info = $file_info->{$infotag} || 
+    my $info = $file_info->{$infotag} ||
 	die "unknown file type '$filename' (no parser registered)\n";
 
     my $parser = $info->{parser};
@@ -503,7 +503,7 @@
     $timeout = 10 if !$timeout;
 
     my $filename = "$lockdir/$lockid";
-    
+
     eval {
 
         local $SIG{ALRM} = sub { die "can't aquire lock for $text '$lockid': got timeout\n"; };
@@ -522,7 +522,7 @@
 		sleep(1);
 	    }
 	}
-	
+
 	# fixed timeout: cfs locks have a timeout of 120
 	# using 60 gives us another 60 seconds to abort the task
 	alarm(60);
@@ -590,11 +590,11 @@
    $msg = "empty message" if !$msg;
 
    $ident = "" if !$ident;
-   $ident = encode("ascii", decode_utf8($ident), 
+   $ident = encode("ascii", decode_utf8($ident),
 		   sub { sprintf "\\u%04x", shift });
 
    my $utf8 = decode_utf8($msg);
-  
+
    my $ascii = encode("ascii", $utf8, sub { sprintf "\\u%04x", shift });
 
    if ($ident) {
@@ -611,7 +611,7 @@
 sub remote_node_ip {
     my ($nodename, $noerr) = @_;
 
-    # fixme: get IP from pmxcfs 
+    # fixme: get IP from pmxcfs
 
 
     # fallback: try to get IP by other means

Modified: pve-cluster/trunk/data/src/logger.c
===================================================================
--- pve-cluster/trunk/data/src/logger.c	2011-02-02 12:03:44 UTC (rev 5479)
+++ pve-cluster/trunk/data/src/logger.c	2011-02-02 12:33:06 UTC (rev 5480)
@@ -755,7 +755,7 @@
 
 	uint32_t pid = 0;
 	if (*p == '[') {
-		p++;
+		*p++ = 0;
 		while (isdigit (*p)) { 
 			pid = pid*10 + *p - '0';
 			p++;



More information about the pve-devel mailing list