Commit 0656568d authored by Leigh Stoller's avatar Leigh Stoller

Add locked_pid to images table. Change virt_nodes:osname regex to allow

URLs, as for importing images.
parent a5126fd3
......@@ -1766,6 +1766,7 @@ CREATE TABLE `images` (
`decryption_key` varchar(256) default NULL,
`hash` varchar(64) default NULL,
`locked` datetime default NULL,
`locker_pid` int(11) default '0',
`metadata_url` tinytext,
`imagefile_url` tinytext,
PRIMARY KEY (`imageid`),
......
......@@ -897,7 +897,7 @@ REPLACE INTO table_regex VALUES ('virt_nodes','failureaction','text','regex','^(
REPLACE INTO table_regex VALUES ('virt_nodes','routertype','text','regex','^(none|ospf|static|manual|static-ddijk|static-old)$',0,0,NULL);
REPLACE INTO table_regex VALUES ('virt_nodes','fixed','text','redirect','default:tinytext',0,128,NULL);
REPLACE INTO table_regex VALUES ('virt_nodes','sharing_mode','text','regex','^[-\\w]+$',1,32,NULL);
REPLACE INTO table_regex VALUES ('virt_nodes','osname','text','regex','^([-\\w]+\\/{0,1})[-\\w\\.+]+$',2,128,NULL);
REPLACE INTO table_regex VALUES ('virt_nodes','osname','text','regex','^((([-\\w]+\\/{0,1})[-\\w\\.+]+)|((http|https|ftp)\\:\\/\\/[-\\w\\.\\/\\@\\:\\~\\?\\=\\&]*))$',2,128,NULL);
REPLACE INTO table_regex VALUES ('virt_nodes','parent_osname','text','regex','^([-\\w]+\\/{0,1})[-\\w\\.+]+$',2,128,NULL);
REPLACE INTO table_regex VALUES ('virt_programs','pid','text','redirect','projects:pid',0,0,NULL);
REPLACE INTO table_regex VALUES ('virt_programs','eid','text','redirect','experiments:eid',0,0,NULL);
......
#
# Add stuff to handle importing images from other locations.
#
use strict;
use libdb;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
if (!DBSlotExists("images", "locker_pid")) {
DBQueryFatal("alter table images add ".
" `locker_pid` int(11) default '0' after locked");
}
DBQueryFatal("REPLACE INTO table_regex VALUES ".
" ('virt_nodes','osname','text','regex', ".
" '^((([-\\\\w]+\\\\/{0,1})[-\\\\w\\\\.+]+)|".
"((http|https|ftp)\\\\:\\\\/\\\\/[-\\\\w\\\\.\\\\/\\\\@\\\\:\\\\~\\\\?\\\\=\\\\&]*))\$', ".
"2,128,NULL)");
return 0;
}
1;
# Local Variables:
# mode:perl
# End:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment