Commit 18a7e659 authored by Leigh B Stoller's avatar Leigh B Stoller

Delete webtasks associated with profiles. Do not allow multi-site links

of more then 2 sites.
parent 000b1c36
......@@ -503,16 +503,18 @@ sub Delete($$)
$purge = 0
if (!defined($purge));
DBQueryWarn("lock tables apt_profiles write, apt_profile_versions write")
DBQueryWarn("lock tables apt_profiles write, apt_profile_versions write, ".
" web_tasks write")
or return -1;
DBQueryWarn("delete from apt_profiles where profileid='$profileid'")
or goto bad;
if ($purge) {
goto bad
if (! DBQueryWarn("delete from apt_profile_versions ".
"where profileid='$profileid'"));
# Delete any associated webtasks too.
DBQueryWarn("delete apt_profile_versions, web_tasks ".
" from apt_profile_versions ".
"left join web_tasks on ".
" web_tasks.object_uuid=apt_profile_versions.uuid ".
"where apt_profile_versions.profileid='$profileid'")
or goto bad;
}
else {
# Set deleted on all of the versions.
......@@ -520,7 +522,15 @@ sub Delete($$)
" deleted=now(),locked=null,locker_pid=0 ".
"where profileid='$profileid'")
or goto bad;
# Delete any leftover webtasks.
DBQueryWarn("delete web_tasks from apt_profile_versions ".
"left join web_tasks on ".
" web_tasks.object_uuid=apt_profile_versions.uuid ".
"where apt_profile_versions.profileid='$profileid'");
}
DBQueryWarn("delete from apt_profiles where profileid='$profileid'")
or goto bad;
DBQueryWarn("unlock tables");
return 0;
......@@ -1058,6 +1068,11 @@ sub SetSites($$$$$$)
if (!exists($linksites{$manager_urn}));
$linksites{$manager_urn} = 1;
}
# Two clusters only (point to point links and lans).
if (keys(%linksites) > 2) {
$$perrmsg = "Multisite links/lans may span at most two clusters";
return 1;
}
# if more then one site for a link, must use the stitcher.
$$pneedstitcher = 1
if (keys(%linksites) > 1);
......
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