Commit 48918911 authored by Srikanth Chikkulapelly's avatar Srikanth Chikkulapelly
Browse files

Inserting max_sliver_lifetime sitevar if max_ticket_lifetime do not exist,...

Inserting max_sliver_lifetime sitevar if max_ticket_lifetime do not exist, Otherwise just updating the existing record.
parent d688fd0d
......@@ -9,11 +9,21 @@ sub DoUpdate($$$)
my ($dbhandle, $dbname, $version) = @_;
# updating the sitevar name and description to make it
# more meaningful.
DBQueryFatal("update sitevariables set name = " .
"'protogeni/max_sliver_lifetime', description = " .
"'The maximum sliver lifetime. When set limits the lifetime of a " .
"sliver.' where name = 'protogeni/max_ticket_lifetime'");
# more meaningful if it exists.
# otherwise insert updated record.
if (TBSiteVarExists("protogeni/max_ticket_lifetime")) {
DBQueryFatal("update sitevariables set name = " .
"'protogeni/max_sliver_lifetime', description = " .
"'The maximum sliver lifetime. When set limits the lifetime " .
"of a sliver.' where name = 'protogeni/max_ticket_lifetime'");
}
else {
DBQueryFatal("INSERT INTO `sitevariables` VALUES " .
"('protogeni/max_sliver_lifetime', '90', '90', " .
"'The maximum sliver lifetime. When set limits the lifetime " .
"of a sliver.',0)");
}
return 0;
}
1;
Supports Markdown
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