[pve-devel] r6450 - in pve-common/trunk: . data data/PVE debian

svn-commits at proxmox.com svn-commits at proxmox.com
Thu Aug 11 07:24:14 CEST 2011


Author: dietmar
Date: 2011-08-11 07:24:14 +0200 (Thu, 11 Aug 2011)
New Revision: 6450

Modified:
   pve-common/trunk/Makefile
   pve-common/trunk/data/ChangeLog
   pve-common/trunk/data/PVE/INotify.pm
   pve-common/trunk/data/PVE/JSONSchema.pm
   pve-common/trunk/data/PVE/RESTHandler.pm
   pve-common/trunk/data/PVE/Tools.pm
   pve-common/trunk/debian/changelog
Log:
	* PVE/*: remove useless 'fixme' comments.

	* PVE/Tools.pm (lock_file): removed $text parameter (to simplify
	code), better timeout error message.



Modified: pve-common/trunk/Makefile
===================================================================
--- pve-common/trunk/Makefile	2011-08-10 12:17:03 UTC (rev 6449)
+++ pve-common/trunk/Makefile	2011-08-11 05:24:14 UTC (rev 6450)
@@ -1,7 +1,7 @@
 RELEASE=2.0
 
 VERSION=1.0
-PKGREL=4
+PKGREL=5
 
 PACKAGE=libpve-common-perl
 

Modified: pve-common/trunk/data/ChangeLog
===================================================================
--- pve-common/trunk/data/ChangeLog	2011-08-10 12:17:03 UTC (rev 6449)
+++ pve-common/trunk/data/ChangeLog	2011-08-11 05:24:14 UTC (rev 6450)
@@ -1,3 +1,10 @@
+2011-08-11  Proxmox Support Team  <support at proxmox.com>
+
+	* PVE/*: remove useless 'fixme' comments.
+
+	* PVE/Tools.pm (lock_file): removed $text parameter (to simplify
+	code), better timeout error message.
+
 2011-08-10  Proxmox Support Team  <support at proxmox.com>
 
 	* PVE/RESTHandler.pm (cli_handler): renamed cli_handler2 to

Modified: pve-common/trunk/data/PVE/INotify.pm
===================================================================
--- pve-common/trunk/data/PVE/INotify.pm	2011-08-10 12:17:03 UTC (rev 6449)
+++ pve-common/trunk/data/PVE/INotify.pm	2011-08-11 05:24:14 UTC (rev 6450)
@@ -1,6 +1,6 @@
 package PVE::INotify;
 
-# fixme: maybe we do not need update_file() ?
+# todo: maybe we do not need update_file() ?
 
 use strict;
 use POSIX;
@@ -173,7 +173,7 @@
 	}
     };
 
-    PVE::Tools::lock_file($lkfn, $timeout, "update_file", $code);
+    PVE::Tools::lock_file($lkfn, $timeout, $code);
     my $err = $@;
 
     close($fd) if defined($fd);

Modified: pve-common/trunk/data/PVE/JSONSchema.pm
===================================================================
--- pve-common/trunk/data/PVE/JSONSchema.pm	2011-08-10 12:17:03 UTC (rev 6449)
+++ pve-common/trunk/data/PVE/JSONSchema.pm	2011-08-11 05:24:14 UTC (rev 6450)
@@ -4,11 +4,10 @@
 use strict;
 use Storable; # for dclone
 use Getopt::Long;
-use Devel::Cycle -quiet; # fixme: remove?
+use Devel::Cycle -quiet; # todo: remove?
 use PVE::Tools qw(split_list);
 use PVE::Exception qw(raise);
 use HTTP::Status qw(:constants);
-use Data::Dumper; # fixme: remove
 
 use base 'Exporter';
 
@@ -109,7 +108,7 @@
 sub pve_verify_node_name {
     my ($node, $noerr) = @_;
 
-    # fixme: use better regex ?
+    # todo: use better regex ?
     if ($node !~ m/^[A-Za-z][[:alnum:]\-]*[[:alnum:]]+$/) {
 	return undef if $noerr;
 	die "value does not look like a valid node name\n";
@@ -421,7 +420,8 @@
 	    if ($schema->{items}) {
 		my $it = ref($schema->{items});
 		if ($it && $it eq 'ARRAY') {
-		    die "implement me $path: $vt " . Dumper($schema) ."\n".  Dumper($value);
+		    #die "implement me $path: $vt " . Dumper($schema) ."\n".  Dumper($value);
+		    die "not implemented";
 		} else {
 		    my $ind = 0;
 		    foreach my $el (@$value) {
@@ -507,9 +507,9 @@
     my $errors = {};
     $errmsg = "Parameter verification failed.\n" if !$errmsg;
 
-    # fixme: cycle detection is only needed for debugging, I guess
+    # todo: cycle detection is only needed for debugging, I guess
     # we can disable that in the final release
-    # fixme: is there a better/faster way to detect cycles?
+    # todo: is there a better/faster way to detect cycles?
     my $cycles = 0;
     find_cycle($instance, sub { $cycles = 1 });
     if ($cycles) {

Modified: pve-common/trunk/data/PVE/RESTHandler.pm
===================================================================
--- pve-common/trunk/data/PVE/RESTHandler.pm	2011-08-10 12:17:03 UTC (rev 6449)
+++ pve-common/trunk/data/PVE/RESTHandler.pm	2011-08-11 05:24:14 UTC (rev 6450)
@@ -11,10 +11,6 @@
 use Text::Wrap;
 use Storable qw(dclone);
 
-# fixme: use new PVE::Exception
-
-use Data::Dumper; # fixme: remove
-
 my $method_registry = {};
 my $method_by_name = {};
 
@@ -335,7 +331,7 @@
 
     my $result = &$func($param); 
 
-    # fixme: this is only to be safe
+    # todo: this is only to be safe - disable?
     if (my $schema = $info->{returns}) {
 	PVE::JSONSchema::validate($result, $schema, "Result verification vailed\n");
     }

Modified: pve-common/trunk/data/PVE/Tools.pm
===================================================================
--- pve-common/trunk/data/PVE/Tools.pm	2011-08-10 12:17:03 UTC (rev 6449)
+++ pve-common/trunk/data/PVE/Tools.pm	2011-08-11 05:24:14 UTC (rev 6450)
@@ -38,7 +38,7 @@
 my $lock_handles =  {};
 
 sub lock_file {
-    my ($filename, $timeout, $text, $code, @param) = @_;
+    my ($filename, $timeout, $code, @param) = @_;
 
     my $res;
 
@@ -46,20 +46,20 @@
 
     eval {
 
-        local $SIG{ALRM} = sub { die "got timeout\n"; };
+        local $SIG{ALRM} = sub { die "got timeout (can't lock '$filename')\n"; };
 
         alarm ($timeout);
 
         if (!$lock_handles->{$$}->{$filename}) {
             $lock_handles->{$$}->{$filename} = new IO::File (">>$filename") ||
-                die "can't open lock for $text '$filename' - $!\n";
+                die "can't open lock file '$filename' - $!\n";
         }
 
         if (!flock ($lock_handles->{$$}->{$filename}, LOCK_EX|LOCK_NB)) {
             print STDERR "trying to aquire lock...";
             if (!flock ($lock_handles->{$$}->{$filename}, LOCK_EX)) {
                 print STDERR " failed\n";
-                die "can't aquire lock for $text '$filename' - $!\n";
+                die "can't aquire lock for '$filename' - $!\n";
             }
             print STDERR " OK\n";
         }

Modified: pve-common/trunk/debian/changelog
===================================================================
--- pve-common/trunk/debian/changelog	2011-08-10 12:17:03 UTC (rev 6449)
+++ pve-common/trunk/debian/changelog	2011-08-11 05:24:14 UTC (rev 6450)
@@ -1,3 +1,9 @@
+libpve-common-perl (1.0-5) unstable; urgency=low
+
+  * cleanups (prepare for beta release)
+
+ -- Proxmox Support Team <support at proxmox.com>  Thu, 11 Aug 2011 07:23:00 +0200
+
 libpve-common-perl (1.0-4) unstable; urgency=low
 
   * CLIHandler.pm: new command 'printmanpod' to generate manual pages.




More information about the pve-devel mailing list