[pve-devel] r5097 - pve-common/trunk

svn-commits at proxmox.com svn-commits at proxmox.com
Tue Sep 7 14:31:24 CEST 2010


Author: dietmar
Date: 2010-09-07 12:31:24 +0000 (Tue, 07 Sep 2010)
New Revision: 5097

Modified:
   pve-common/trunk/ChangeLog
   pve-common/trunk/JSONSchema.pm
Log:
	* JSONSchema.pm (check_format): return parsed value



Modified: pve-common/trunk/ChangeLog
===================================================================
--- pve-common/trunk/ChangeLog	2010-09-07 10:26:38 UTC (rev 5096)
+++ pve-common/trunk/ChangeLog	2010-09-07 12:31:24 UTC (rev 5097)
@@ -1,5 +1,7 @@
 2010-09-07  Proxmox Support Team  <support at proxmox.com>
 
+	* JSONSchema.pm (check_format): return parsed value
+
 	* ProcFSTools.pm: new file - utilities to read /proc/
 
 	* ProcFSTools.pm (get_cpu_info):  read cpu info from /proc

Modified: pve-common/trunk/JSONSchema.pm
===================================================================
--- pve-common/trunk/JSONSchema.pm	2010-09-07 10:26:38 UTC (rev 5096)
+++ pve-common/trunk/JSONSchema.pm	2010-09-07 12:31:24 UTC (rev 5097)
@@ -29,7 +29,7 @@
 sub check_format {
     my ($format, $value) = @_;
 
-    return if $format eq 'regex';
+    return $value if $format eq 'regex';
 
     if ($format =~ m/^(.*)-list$/) {
 	
@@ -37,16 +37,20 @@
 
 	die "undefined format '$format'\n" if !$code;
 
+	my @ra = ();
 	foreach my $v (split_list($value)) {
-	    &$code($v);
+	    push @ra, &$code($v);
 	}
+
+	return join(',', @ra);
+
     } else {
 
 	my $code = $format_list->{$format};
 
 	die "undefined format '$format'\n" if !$code;
 
-	&$code($value);
+	return &$code($value);
     }
 } 
 



More information about the pve-devel mailing list