From ec7b480421cae98a61041be7daf7d21ab09d195d Mon Sep 17 00:00:00 2001 From: "Francois @fanf42 Armand" Date: Fri, 29 Nov 2024 17:51:55 +0100 Subject: [PATCH] Fixes #25982: Disable metrics pop-up and form --- .../services/policies/SystemVariableService.scala | 14 +++----------- .../scala/com/normation/rudder/MockServices.scala | 1 - .../rudder/services/policies/NodeConfigData.scala | 1 - .../scala/bootstrap/liftweb/RudderConfig.scala | 1 - .../administration/policyServerManagement.html | 5 ++--- 5 files changed, 5 insertions(+), 17 deletions(-) diff --git a/webapp/sources/rudder/rudder-core/src/main/scala/com/normation/rudder/services/policies/SystemVariableService.scala b/webapp/sources/rudder/rudder-core/src/main/scala/com/normation/rudder/services/policies/SystemVariableService.scala index b893c3040ad..02a5c9498fd 100644 --- a/webapp/sources/rudder/rudder-core/src/main/scala/com/normation/rudder/services/policies/SystemVariableService.scala +++ b/webapp/sources/rudder/rudder-core/src/main/scala/com/normation/rudder/services/policies/SystemVariableService.scala @@ -141,7 +141,6 @@ class SystemVariableServiceImpl( getModifiedFilesTtl: () => Box[Int], getCfengineOutputsTtl: () => Box[Int], - getSendMetrics: () => Box[Option[SendMetrics]], getReportProtocolDefault: () => Box[AgentReportingProtocol] ) extends SystemVariableService with Loggable { @@ -188,15 +187,8 @@ class SystemVariableServiceImpl( val varServerVersion = systemVariableSpecService.get("SERVER_VERSION").toVariable(Seq(serverVersion)) - import SendMetrics.* - val sendMetricsValue = getSendMetrics().getOrElse(None) match { - case None => "no" - case Some(NoMetrics) => "no" - case Some(MinimalMetrics) => "minimal" - case Some(CompleteMetrics) => "complete" - } - - val varSendMetrics = systemVariableSpecService.get("SEND_METRICS").toVariable(Seq(sendMetricsValue)) + // always disable send metrics - see https://issues.rudder.io/issues/25982 + val varSendMetrics = systemVariableSpecService.get("SEND_METRICS").toVariable(Seq("no")) logger.trace("Global system variables done") val vars = { @@ -225,7 +217,7 @@ class SystemVariableServiceImpl( // for this method to work properly // The global system variables are computed before (in the method up there), and - // can be overriden by some node specific parameters (especially, the schedule for + // can be overridden by some node specific parameters (especially, the schedule for // policy servers) def getSystemVariables( nodeInfo: CoreNodeFact, diff --git a/webapp/sources/rudder/rudder-core/src/test/scala/com/normation/rudder/MockServices.scala b/webapp/sources/rudder/rudder-core/src/test/scala/com/normation/rudder/MockServices.scala index 8b299d29f9e..8bf14e7deb8 100644 --- a/webapp/sources/rudder/rudder-core/src/test/scala/com/normation/rudder/MockServices.scala +++ b/webapp/sources/rudder/rudder-core/src/test/scala/com/normation/rudder/MockServices.scala @@ -350,7 +350,6 @@ class MockTechniques(configurationRepositoryRoot: File, mockGit: MockGitConfigRe getModifiedFilesTtl = () => Full(30), getCfengineOutputsTtl = () => Full(7), - getSendMetrics = () => Full(None), getReportProtocolDefault = () => Full(AgentReportingHTTPS) ) diff --git a/webapp/sources/rudder/rudder-core/src/test/scala/com/normation/rudder/services/policies/NodeConfigData.scala b/webapp/sources/rudder/rudder-core/src/test/scala/com/normation/rudder/services/policies/NodeConfigData.scala index f9bf42d80fd..fc2288d0896 100644 --- a/webapp/sources/rudder/rudder-core/src/test/scala/com/normation/rudder/services/policies/NodeConfigData.scala +++ b/webapp/sources/rudder/rudder-core/src/test/scala/com/normation/rudder/services/policies/NodeConfigData.scala @@ -832,7 +832,6 @@ class TestNodeConfiguration( getModifiedFilesTtl = () => Full(30), getCfengineOutputsTtl = () => Full(7), - getSendMetrics = () => Full(None), getReportProtocolDefault = () => Full(AgentReportingHTTPS) ) diff --git a/webapp/sources/rudder/rudder-web/src/main/scala/bootstrap/liftweb/RudderConfig.scala b/webapp/sources/rudder/rudder-web/src/main/scala/bootstrap/liftweb/RudderConfig.scala index 8684b5193bb..54ee93713ed 100644 --- a/webapp/sources/rudder/rudder-web/src/main/scala/bootstrap/liftweb/RudderConfig.scala +++ b/webapp/sources/rudder/rudder-web/src/main/scala/bootstrap/liftweb/RudderConfig.scala @@ -3032,7 +3032,6 @@ object RudderConfigInit { () => configService.relay_server_syncsharedfiles().toBox, () => configService.cfengine_modified_files_ttl().toBox, () => configService.cfengine_outputs_ttl().toBox, - () => configService.send_server_metrics().toBox, () => configService.rudder_report_protocol_default().toBox ) lazy val rudderCf3PromisesFileWriterService = new PolicyWriterServiceImpl( diff --git a/webapp/sources/rudder/rudder-web/src/main/webapp/secure/administration/policyServerManagement.html b/webapp/sources/rudder/rudder-web/src/main/webapp/secure/administration/policyServerManagement.html index 787668e87cd..3b7dbba5430 100644 --- a/webapp/sources/rudder/rudder-web/src/main/webapp/secure/administration/policyServerManagement.html +++ b/webapp/sources/rudder/rudder-web/src/main/webapp/secure/administration/policyServerManagement.html @@ -630,8 +630,8 @@

Debug information

-
-

Usage survey

+
+

Usage survey

@@ -667,7 +667,6 @@

Usage survey

-