From cf0da96b879482e975064a7d25a1ae853a8f7821 Mon Sep 17 00:00:00 2001 From: Konstantina Chremmou Date: Thu, 9 Apr 2020 16:44:46 +0100 Subject: [PATCH] CA-187943: Revised warning messages to take account the selected affinity. Signed-off-by: Konstantina Chremmou --- XenAdmin/Wizards/NewVMWizard/Page_Storage.cs | 10 +++++++-- XenModel/Messages.Designer.cs | 22 ++++++++++++++++++-- XenModel/Messages.resx | 6 ++++++ 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/XenAdmin/Wizards/NewVMWizard/Page_Storage.cs b/XenAdmin/Wizards/NewVMWizard/Page_Storage.cs index 53c061c6e..ce51ec113 100644 --- a/XenAdmin/Wizards/NewVMWizard/Page_Storage.cs +++ b/XenAdmin/Wizards/NewVMWizard/Page_Storage.cs @@ -201,7 +201,10 @@ namespace XenAdmin.Wizards.NewVMWizard if (suggestedSrVisible) sb.AppendFormat(Messages.NEWVMWIZARD_STORAGEPAGE_SUGGESTED_NOSPACE, suggestedSr.Name().Ellipsise(50)).AppendLine(); else if (suggestedSrHasSpace) - sb.AppendFormat(Messages.NEWVMWIZARD_STORAGEPAGE_SUGGESTED_LOCAL, suggestedSr.Name().Ellipsise(50)).AppendLine(); + sb.AppendFormat(Affinity == null + ? Messages.NEWVMWIZARD_STORAGEPAGE_SUGGESTED_LOCAL_NO_HOME + : Messages.NEWVMWIZARD_STORAGEPAGE_SUGGESTED_LOCAL, + suggestedSr.Name().Ellipsise(50)).AppendLine(); SR defaultSr = connection.Resolve(Helpers.GetPoolOfOne(connection).default_SR); var defaultSrVisible = defaultSr != null && defaultSr.CanBeSeenFrom(affinity); @@ -221,7 +224,10 @@ namespace XenAdmin.Wizards.NewVMWizard if (defaultSrVisible && !defaultSr.Equals(suggestedSr)) sb.AppendFormat(Messages.NEWVMWIZARD_STORAGEPAGE_DEFAULT_NOSPACE, defaultSr.Name().Ellipsise(50)).AppendLine(); else if (defaultSrHasSpace && !defaultSr.Equals(suggestedSr)) - sb.AppendFormat(Messages.NEWVMWIZARD_STORAGEPAGE_DEFAULT_LOCAL, defaultSr.Name().Ellipsise(50)).AppendLine(); + sb.AppendFormat(Affinity == null + ? Messages.NEWVMWIZARD_STORAGEPAGE_DEFAULT_LOCAL_NO_HOME + : Messages.NEWVMWIZARD_STORAGEPAGE_DEFAULT_LOCAL, + defaultSr.Name().Ellipsise(50)).AppendLine(); foreach (SR sr in connection.Cache.SRs) { diff --git a/XenModel/Messages.Designer.cs b/XenModel/Messages.Designer.cs index e5057004e..7ac1df50c 100755 --- a/XenModel/Messages.Designer.cs +++ b/XenModel/Messages.Designer.cs @@ -27099,7 +27099,7 @@ namespace XenAdmin { } /// - /// Looks up a localized string similar to VMs without a home server cannot have disks on the default SR '{0}'.. + /// Looks up a localized string similar to The default SR '{0}' cannot be seen from the VM's home server.. /// public static string NEWVMWIZARD_STORAGEPAGE_DEFAULT_LOCAL { get { @@ -27107,6 +27107,15 @@ namespace XenAdmin { } } + /// + /// Looks up a localized string similar to VMs without a home server cannot have disks on the default SR '{0}'.. + /// + public static string NEWVMWIZARD_STORAGEPAGE_DEFAULT_LOCAL_NO_HOME { + get { + return ResourceManager.GetString("NEWVMWIZARD_STORAGEPAGE_DEFAULT_LOCAL_NO_HOME", resourceCulture); + } + } + /// /// Looks up a localized string similar to The default SR '{0}' does not have enough free space for the new VM's disks.. /// @@ -27162,7 +27171,7 @@ namespace XenAdmin { } /// - /// Looks up a localized string similar to VMs without a home server cannot have disks on the SR suggested by the template ('{0}').. + /// Looks up a localized string similar to The SR suggested by the template ('{0}') cannot be seen from the VM's home server.. /// public static string NEWVMWIZARD_STORAGEPAGE_SUGGESTED_LOCAL { get { @@ -27170,6 +27179,15 @@ namespace XenAdmin { } } + /// + /// Looks up a localized string similar to VMs without a home server cannot have disks on the SR suggested by the template ('{0}').. + /// + public static string NEWVMWIZARD_STORAGEPAGE_SUGGESTED_LOCAL_NO_HOME { + get { + return ResourceManager.GetString("NEWVMWIZARD_STORAGEPAGE_SUGGESTED_LOCAL_NO_HOME", resourceCulture); + } + } + /// /// Looks up a localized string similar to The SR suggested by the template ('{0}') does not have enough free space for the new VM's disks.. /// diff --git a/XenModel/Messages.resx b/XenModel/Messages.resx index b251ac001..a71a6157d 100755 --- a/XenModel/Messages.resx +++ b/XenModel/Messages.resx @@ -9259,6 +9259,9 @@ Review these settings, then click Previous if you need to change anything. Other Created by template provisioner + The default SR '{0}' cannot be seen from the VM's home server. + + VMs without a home server cannot have disks on the default SR '{0}'. @@ -9268,6 +9271,9 @@ Review these settings, then click Previous if you need to change anything. Other Storage + The SR suggested by the template ('{0}') cannot be seen from the VM's home server. + + VMs without a home server cannot have disks on the SR suggested by the template ('{0}').