From 2766a189878c9ad30eda7b225139bfbf2cccebab Mon Sep 17 00:00:00 2001 From: Mihaela Stoica Date: Tue, 15 Sep 2015 13:55:18 +0100 Subject: [PATCH] Use the ToString() function directly for enum-to-string conversions Signed-off-by: Mihaela Stoica --- .../HealthCheck/GetHealthCheckAnalysisResultAction.cs | 2 +- XenModel/HealthCheckSettings.cs | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/XenModel/Actions/HealthCheck/GetHealthCheckAnalysisResultAction.cs b/XenModel/Actions/HealthCheck/GetHealthCheckAnalysisResultAction.cs index c785a8c32..ebbac9a4a 100644 --- a/XenModel/Actions/HealthCheck/GetHealthCheckAnalysisResultAction.cs +++ b/XenModel/Actions/HealthCheck/GetHealthCheckAnalysisResultAction.cs @@ -83,7 +83,7 @@ namespace XenAdmin.Actions var analysisResult = GetAnalysisResult(diagnosticToken, Pool.HealthCheckSettings.UploadUuid); log.Info("Saving analysis result"); Dictionary newConfig = Pool.health_check_config; - newConfig[HealthCheckSettings.REPORT_ANALYSIS_SEVERITY] = HealthCheckSettings.DiagnosticAlertSeverityToString(GetMaxSeverity(analysisResult)); + newConfig[HealthCheckSettings.REPORT_ANALYSIS_SEVERITY] = GetMaxSeverity(analysisResult).ToString(); newConfig[HealthCheckSettings.REPORT_ANALYSIS_ISSUES_DETECTED] = analysisResult.Count.ToString(); newConfig[HealthCheckSettings.REPORT_ANALYSIS_UPLOAD_UUID] = Pool.HealthCheckSettings.UploadUuid; newConfig[HealthCheckSettings.REPORT_ANALYSIS_UPLOAD_TIME] = Pool.HealthCheckSettings.LastSuccessfulUpload; diff --git a/XenModel/HealthCheckSettings.cs b/XenModel/HealthCheckSettings.cs index fb5d2e929..b437127b1 100644 --- a/XenModel/HealthCheckSettings.cs +++ b/XenModel/HealthCheckSettings.cs @@ -382,10 +382,5 @@ namespace XenAdmin.Model return result; return DiagnosticAlertSeverity.Info; } - - internal static string DiagnosticAlertSeverityToString(DiagnosticAlertSeverity severity) - { - return severity.ToString(); - } } }