mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2024-11-25 14:27:26 +01:00
commit
273383c567
@ -730,7 +730,6 @@ namespace XenAdmin.Commands
|
||||
items.Add(new DisconnectPoolCommand(mainWindow, selection));
|
||||
items.Add(new PoolReconnectAsCommand(mainWindow, selection));
|
||||
items.AddSeparator();
|
||||
items.Add(new DeletePoolCommand(mainWindow, selection));
|
||||
items.AddPluginItems(PluginContextMenu.pool, selection);
|
||||
items.AddSeparator();
|
||||
items.Add(new PoolPropertiesCommand(mainWindow, selection));
|
||||
|
@ -74,12 +74,9 @@ namespace XenAdmin.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
if (ShowConfirmationDialog())
|
||||
if (conn.IsConnected)
|
||||
{
|
||||
if (conn.IsConnected)
|
||||
{
|
||||
new DestroyPoolAction(pool).RunAsync();
|
||||
}
|
||||
new DestroyPoolAction(pool).RunAsync();
|
||||
}
|
||||
}
|
||||
|
||||
@ -103,23 +100,5 @@ namespace XenAdmin.Commands
|
||||
return Messages.MAINWINDOW_DELETE_POOL;
|
||||
}
|
||||
}
|
||||
|
||||
protected override string ConfirmationDialogText
|
||||
{
|
||||
get
|
||||
{
|
||||
SelectedItemCollection selection = GetSelection();
|
||||
Pool pool = (Pool)selection[0].PoolAncestor;
|
||||
return string.Format(Messages.MESSAGEBOX_POOL_DELETE, pool.Name);
|
||||
}
|
||||
}
|
||||
|
||||
public override string ContextMenuText
|
||||
{
|
||||
get
|
||||
{
|
||||
return Messages.MAINWINDOW_DELETE_POOL_CONTEXT_MENU;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -29,6 +29,8 @@
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
|
||||
namespace XenAdmin.Actions
|
||||
{
|
||||
public class DestroyPoolAction: PureAsyncAction
|
||||
@ -36,7 +38,6 @@ namespace XenAdmin.Actions
|
||||
public DestroyPoolAction(XenAPI.Pool pool)
|
||||
: base(pool.Connection, string.Format(Messages.DESTROYING_POOL, pool.Name))
|
||||
{
|
||||
|
||||
System.Diagnostics.Trace.Assert(pool != null);
|
||||
Pool = pool;
|
||||
this.Description = Messages.WAITING;
|
||||
@ -46,21 +47,8 @@ namespace XenAdmin.Actions
|
||||
{
|
||||
|
||||
this.Description = Messages.POOLCREATE_DESTROYING;
|
||||
int n = Connection.Cache.HostCount;
|
||||
string master = Pool.master;
|
||||
double p = 100.0 / n; // We have n - 1 to eject, and then 1 to rename.
|
||||
int i = 0;
|
||||
foreach (XenAPI.Host host in Connection.Cache.Hosts)
|
||||
{
|
||||
if (host.opaque_ref != master)
|
||||
{
|
||||
int lo = (int)(i * p);
|
||||
int hi = (int)((i + 1) * p);
|
||||
RelatedTask = XenAPI.Pool.async_eject(Session, host.opaque_ref);
|
||||
PollToCompletion(lo, hi);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
if (Connection.Cache.HostCount != 1)
|
||||
throw new Exception("Cannot destroy a pool of more than one host"); // We should not have any UI to reach here, and must not be allowed to proceed
|
||||
XenAPI.Pool.set_name_label(Session, Pool.opaque_ref, "");
|
||||
XenAPI.Pool.set_name_description(Session, Pool.opaque_ref, "");
|
||||
this.Description = Messages.POOLCREATE_DESTROYED;
|
||||
|
17
XenModel/Messages.Designer.cs
generated
17
XenModel/Messages.Designer.cs
generated
@ -9425,7 +9425,7 @@ namespace XenAdmin {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Destroying pool '{0}'.
|
||||
/// Looks up a localized string similar to Making pool '{0}' into standalone server.
|
||||
/// </summary>
|
||||
public static string DESTROYING_POOL {
|
||||
get {
|
||||
@ -18361,7 +18361,7 @@ namespace XenAdmin {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to &Delete Pool....
|
||||
/// Looks up a localized string similar to Mak&e into standalone server.
|
||||
/// </summary>
|
||||
public static string MAINWINDOW_DELETE_POOL {
|
||||
get {
|
||||
@ -18369,15 +18369,6 @@ namespace XenAdmin {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Delete &Pool....
|
||||
/// </summary>
|
||||
public static string MAINWINDOW_DELETE_POOL_CONTEXT_MENU {
|
||||
get {
|
||||
return ResourceManager.GetString("MAINWINDOW_DELETE_POOL_CONTEXT_MENU", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to &Delete Tag....
|
||||
/// </summary>
|
||||
@ -24805,7 +24796,7 @@ namespace XenAdmin {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Destroyed pool.
|
||||
/// Looks up a localized string similar to Made pool into standalone server.
|
||||
/// </summary>
|
||||
public static string POOLCREATE_DESTROYED {
|
||||
get {
|
||||
@ -24814,7 +24805,7 @@ namespace XenAdmin {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Destroying pool.
|
||||
/// Looks up a localized string similar to Making pool into standalone server.
|
||||
/// </summary>
|
||||
public static string POOLCREATE_DESTROYING {
|
||||
get {
|
||||
|
@ -3349,7 +3349,7 @@ This will also delete its subfolders.</value>
|
||||
<value>Destroying servers</value>
|
||||
</data>
|
||||
<data name="DESTROYING_POOL" xml:space="preserve">
|
||||
<value>Destroying pool '{0}'</value>
|
||||
<value>Making pool '{0}' into standalone server</value>
|
||||
</data>
|
||||
<data name="DESTROY_HOST_ACTION_COMPLETED_DESC" xml:space="preserve">
|
||||
<value>Host destroyed</value>
|
||||
@ -6404,10 +6404,7 @@ This will permanently delete and reinitialize all local storage on the servers.
|
||||
<value>De&lete...</value>
|
||||
</data>
|
||||
<data name="MAINWINDOW_DELETE_POOL" xml:space="preserve">
|
||||
<value>&Delete Pool...</value>
|
||||
</data>
|
||||
<data name="MAINWINDOW_DELETE_POOL_CONTEXT_MENU" xml:space="preserve">
|
||||
<value>Delete &Pool...</value>
|
||||
<value>Mak&e into standalone server</value>
|
||||
</data>
|
||||
<data name="MAINWINDOW_DELETE_TAG" xml:space="preserve">
|
||||
<value>&Delete Tag...</value>
|
||||
@ -8567,10 +8564,10 @@ The VM protection policy for this VM does not have automatic archiving configure
|
||||
<value>Creating pool</value>
|
||||
</data>
|
||||
<data name="POOLCREATE_DESTROYED" xml:space="preserve">
|
||||
<value>Destroyed pool</value>
|
||||
<value>Made pool into standalone server</value>
|
||||
</data>
|
||||
<data name="POOLCREATE_DESTROYING" xml:space="preserve">
|
||||
<value>Destroying pool</value>
|
||||
<value>Making pool into standalone server</value>
|
||||
</data>
|
||||
<data name="POOLCREATE_REMOVED" xml:space="preserve">
|
||||
<value>Removed from pool</value>
|
||||
|
Loading…
Reference in New Issue
Block a user