mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2024-11-27 02:56:01 +01:00
Merge pull request #3011 from kc284/CA-366140
CA-366140: Reverted original solution. Handled error thrown when retrieving datasources.
This commit is contained in:
commit
afa21f16a9
@ -80,7 +80,7 @@ namespace XenAdmin.Actions
|
||||
else
|
||||
Host.forget_data_source_archives(Session, host.opaque_ref, ds.DataSource.name_label);
|
||||
}
|
||||
else if (_xenObject is VM vm && vm.allowed_operations.Contains(vm_operations.data_source_op))
|
||||
else if (_xenObject is VM vm)
|
||||
{
|
||||
if (ds.Enabled)
|
||||
VM.record_data_source(Session, vm.opaque_ref, ds.DataSource.name_label);
|
||||
|
@ -191,19 +191,24 @@ namespace XenAdmin.Controls.CustomDataGraph
|
||||
foreach (DataArchive a in Archives.Values)
|
||||
a.ClearSets();
|
||||
|
||||
LoadingInitialData = true;
|
||||
ArchivesUpdated?.Invoke();
|
||||
|
||||
try
|
||||
{
|
||||
LoadingInitialData = true;
|
||||
ArchivesUpdated?.Invoke();
|
||||
|
||||
if (xenObject is Host h)
|
||||
_dataSources = Host.get_data_sources(h.Connection.Session, h.opaque_ref);
|
||||
else if (xenObject is VM vm && vm.power_state == vm_power_state.Running &&
|
||||
vm.allowed_operations.Contains(vm_operations.data_source_op))
|
||||
else if (xenObject is VM vm && vm.power_state == vm_power_state.Running)
|
||||
_dataSources = VM.get_data_sources(vm.Connection.Session, vm.opaque_ref);
|
||||
|
||||
Get(ArchiveInterval.None, RrdsUri, RRD_Full_InspectCurrentNode, xenObject);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
//Get handles its own exception;
|
||||
//anything caught here is thrown by the get_data_sources operations
|
||||
log.Error($"Failed to retrieve data sources for '{xenObject.Name()}'", e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
LoadingInitialData = false;
|
||||
|
@ -52,7 +52,7 @@ namespace XenAdmin.Actions
|
||||
{
|
||||
List<Data_source> sources;
|
||||
|
||||
if (XenObject is VM vm && vm.allowed_operations.Contains(vm_operations.data_source_op))
|
||||
if (XenObject is VM vm)
|
||||
sources = VM.get_data_sources(Session, vm.opaque_ref);
|
||||
else if (XenObject is Host host)
|
||||
sources = Host.get_data_sources(Session, host.opaque_ref);
|
||||
@ -106,7 +106,7 @@ namespace XenAdmin.Actions
|
||||
Host.record_data_source(Session, Host.opaque_ref, _dataSource.name_label);
|
||||
DataSources = Host.get_data_sources(Session, Host.opaque_ref);
|
||||
}
|
||||
else if (VM != null && VM.allowed_operations.Contains(vm_operations.data_source_op))
|
||||
else if (VM != null)
|
||||
{
|
||||
VM.record_data_source(Session, VM.opaque_ref, _dataSource.name_label);
|
||||
DataSources = VM.get_data_sources(Session, VM.opaque_ref);
|
||||
|
Loading…
Reference in New Issue
Block a user