mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2024-11-23 20:36:33 +01:00
CA-123013: Cloning from template shouldn't allow progress through the New VM wizard without shared SR.
On the affinity picker, the "no home server" radio button is disabled if there is no shared storage, except on editing an existing VM that already has no affinity. Signed-off-by: Mihaela Stoica <mihaela.stoica@citrix.com>
This commit is contained in:
parent
f0021bf7d7
commit
4f548d6320
@ -49,6 +49,13 @@ namespace XenAdmin.Controls
|
||||
private Host SrHost;
|
||||
private Host Affinity;
|
||||
|
||||
/// <summary>
|
||||
/// Should always be true if the AffinityPicker is used to create a VM.
|
||||
/// If set to false (e.g. on Edit VM) and Affinity is null, then the "no home server" radio button remains enabled,
|
||||
/// meaning that the VM already has no affinity and should not try to automatically select one.
|
||||
/// </summary>
|
||||
internal bool AutoSelectAffinity = true;
|
||||
|
||||
public event EventHandler SelectedAffinityChanged = new EventHandler(OnSelectedAffinityChanged);
|
||||
|
||||
private static void OnSelectedAffinityChanged(object obj, EventArgs e) { }
|
||||
@ -96,7 +103,8 @@ namespace XenAdmin.Controls
|
||||
return;
|
||||
|
||||
// Update enablement
|
||||
DynamicRadioButton.Enabled = (Helpers.HasFullyConnectedSharedStorage(Connection) && SrHost == null) || Affinity == null;
|
||||
DynamicRadioButton.Enabled = (Helpers.HasFullyConnectedSharedStorage(Connection) && SrHost == null) ||
|
||||
(Affinity == null && !AutoSelectAffinity);
|
||||
ServersGridView.Enabled = StaticRadioButton.Checked;
|
||||
DynamicRadioButton.Text = Helpers.HasFullyConnectedSharedStorage(Connection)
|
||||
? Messages.AFFINITY_PICKER_DYNAMIC_SHARED_SR
|
||||
|
@ -55,7 +55,7 @@ namespace XenAdmin.SettingsPanels
|
||||
{
|
||||
InitializeComponent();
|
||||
Text = Messages.HOME_SERVER;
|
||||
|
||||
picker.AutoSelectAffinity = false;
|
||||
}
|
||||
|
||||
#region IEditPage Members
|
||||
|
Loading…
Reference in New Issue
Block a user