mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2024-11-23 20:36:33 +01:00
CP:13667: Adds condition that checks if sm_config contains the keys "allocation_quantum" and "initial_allocation" before getting the values.
This commit is contained in:
parent
1bb49737b2
commit
7c53955104
@ -100,7 +100,7 @@ namespace XenAdmin.SettingsPanels
|
||||
= initial_allocation_label.Visible
|
||||
= incremental_allocation_label.Visible = sr.IsThinProvisioned;
|
||||
|
||||
if(sr.IsThinProvisioned)
|
||||
if(sr.IsThinProvisioned && vdi.sm_config.ContainsKey("initial_allocation") && vdi.sm_config.ContainsKey("allocation_quantum"))
|
||||
{
|
||||
initial_alloc_value.Text = Util.MemorySizeStringSuitableUnits(Convert.ToDouble(vdi.sm_config["initial_allocation"]) * Util.BINARY_MEGA, true);
|
||||
incr_alloc_value.Text = Util.MemorySizeStringSuitableUnits(Convert.ToDouble(vdi.sm_config["allocation_quantum"]) * Util.BINARY_MEGA, true);
|
||||
|
@ -1244,7 +1244,7 @@ namespace XenAdmin.TabPages
|
||||
{
|
||||
s.AddEntry(FriendlyName("SR.size"), sr.SizeString);
|
||||
s.AddEntry(FriendlyName("SR.provisioning"), sr.IsThinProvisioned ? Messages.SR_THIN_PROVISIONING : Messages.SR_THICK_PROVISIONING);
|
||||
if(sr.IsThinProvisioned)
|
||||
if(sr.IsThinProvisioned && sr.sm_config.ContainsKey("initial_allocation") && sr.sm_config.ContainsKey("allocation_quantum"))
|
||||
{
|
||||
s.AddEntry(FriendlyName("SR.disk-space-allocations"),
|
||||
Helpers.GetAllocationProperties(sr.sm_config["initial_allocation"], sr.sm_config["allocation_quantum"]));
|
||||
|
Loading…
Reference in New Issue
Block a user