CS-14907: Only allow download volume for uploaded volumes

This fixes an issue where an uploaded volume that hasn't been moved to
primary storage yet is downloaded, causing an error. This adjusts the
actionFilter to fix this.

Original patch by: Pranav Saxena <pranav.saxena@citrix.com>
reviewed-by: Brian Federle <brian.federle@citrix.com>
This commit is contained in:
Brian Federle 2012-07-02 10:41:20 -07:00
parent de04b8cb79
commit b70bc92f46

View File

@ -1310,7 +1310,7 @@
allowedActions.push("recurringSnapshot");
}
if(jsonObj.state != "Allocated") {
if(jsonObj.vmstate == "Stopped" || jsonObj.virtualmachineid == null) {
if((jsonObj.vmstate == "Stopped" || jsonObj.virtualmachineid == null) && jsonObj.state != "Ready") {
allowedActions.push("downloadVolume");
}
}