From 3c86297d117e173bfaeb70bbda00a39d7c527ffb Mon Sep 17 00:00:00 2001 From: To-om Date: Wed, 28 Oct 2020 15:29:22 +0100 Subject: [PATCH] #1478 Remove warnings --- .../scala/org/thp/thehive/migration/Migrate.scala | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/migration/src/main/scala/org/thp/thehive/migration/Migrate.scala b/migration/src/main/scala/org/thp/thehive/migration/Migrate.scala index 3c244a5085..c946b48ad1 100644 --- a/migration/src/main/scala/org/thp/thehive/migration/Migrate.scala +++ b/migration/src/main/scala/org/thp/thehive/migration/Migrate.scala @@ -1,8 +1,6 @@ package org.thp.thehive.migration import java.io.File -import java.text.SimpleDateFormat -import java.util.Date import akka.actor.ActorSystem import akka.stream.Materializer @@ -76,11 +74,11 @@ object Migrate extends App with MigrationOps { opt[String]("case-from-date") .valueName("") .text("migrate only cases created from ") - .action((v, c) => addConfig(c, "input.filter.caseFromDate" -> v.toString)), + .action((v, c) => addConfig(c, "input.filter.caseFromDate" -> v)), opt[String]("case-until-date") .valueName("") .text("migrate only cases created until ") - .action((v, c) => addConfig(c, "input.filter.caseUntilDate" -> v.toString)), + .action((v, c) => addConfig(c, "input.filter.caseUntilDate" -> v)), /* case number */ opt[Duration]("case-from-number") .valueName("") @@ -102,11 +100,11 @@ object Migrate extends App with MigrationOps { opt[String]("alert-from-date") .valueName("") .text("migrate only alerts created from ") - .action((v, c) => addConfig(c, "input.filter.alertFromDate" -> v.toString)), + .action((v, c) => addConfig(c, "input.filter.alertFromDate" -> v)), opt[String]("alert-until-date") .valueName("") .text("migrate only alerts created until ") - .action((v, c) => addConfig(c, "input.filter.alertUntilDate" -> v.toString)), + .action((v, c) => addConfig(c, "input.filter.alertUntilDate" -> v)), /* audit age */ opt[Duration]("max-audit-age") .valueName("") @@ -119,11 +117,11 @@ object Migrate extends App with MigrationOps { opt[String]("audit-from-date") .valueName("") .text("migrate only audits created from ") - .action((v, c) => addConfig(c, "input.filter.auditFromDate" -> v.toString)), + .action((v, c) => addConfig(c, "input.filter.auditFromDate" -> v)), opt[String]("audit-until-date") .valueName("") .text("migrate only audits created until ") - .action((v, c) => addConfig(c, "input.filter.auditUntilDate" -> v.toString)), + .action((v, c) => addConfig(c, "input.filter.auditUntilDate" -> v)), note("Accepted date formats are \"yyyyMMdd[HH[mm[ss]]]\" and \"MMdd\""), note( "The Format for duration is: .\n" +