[pve-devel] r5110 - pve-common/trunk
svn-commits at proxmox.com
svn-commits at proxmox.com
Fri Sep 10 13:44:39 CEST 2010
Author: dietmar
Date: 2010-09-10 11:44:39 +0000 (Fri, 10 Sep 2010)
New Revision: 5110
Modified:
pve-common/trunk/JSONSchema.pm
Log:
Modified: pve-common/trunk/JSONSchema.pm
===================================================================
--- pve-common/trunk/JSONSchema.pm 2010-09-10 10:14:18 UTC (rev 5109)
+++ pve-common/trunk/JSONSchema.pm 2010-09-10 11:44:39 UTC (rev 5110)
@@ -26,6 +26,15 @@
$format_list->{$format} = $code;
}
+# register some common type for pve
+register_format('pve-configid', sub {
+ my $id = shift;
+
+ die "invalid cofiguration ID '$id'\n" if $id !~ m/^[a-z][a-z0-9_]+$/i;
+
+ return $id;
+});
+
sub check_format {
my ($format, $value) = @_;
More information about the pve-devel
mailing list