From 64dd54385c3598148b161c5d05f3dfb378966474 Mon Sep 17 00:00:00 2001 From: Gabe Conradi Date: Thu, 9 Mar 2017 17:09:59 -0500 Subject: [PATCH] make pool name conversion always return default when it should --- .../controllers/actions/ipaddress/AddressActionHelper.scala | 6 ++---- .../controllers/actions/ipaddress/GetPoolsAction.scala | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/collins/controllers/actions/ipaddress/AddressActionHelper.scala b/app/collins/controllers/actions/ipaddress/AddressActionHelper.scala index 353134489..5c497e254 100644 --- a/app/collins/controllers/actions/ipaddress/AddressActionHelper.scala +++ b/app/collins/controllers/actions/ipaddress/AddressActionHelper.scala @@ -27,10 +27,8 @@ trait AddressActionHelper { self: SecureAction => )) } - def convertPoolName(name: String, emptyToDef: Boolean = false) = name match { - case default if default.equalsIgnoreCase(IpAddressConfig.DefaultPoolName) => - "" - case empty if empty.isEmpty && emptyToDef => + def convertPoolName(name: String) = name match { + case empty if empty.isEmpty => IpAddressConfig.DefaultPoolName case other => other.toUpperCase } diff --git a/app/collins/controllers/actions/ipaddress/GetPoolsAction.scala b/app/collins/controllers/actions/ipaddress/GetPoolsAction.scala index fbd85ab19..bd33ba1c7 100644 --- a/app/collins/controllers/actions/ipaddress/GetPoolsAction.scala +++ b/app/collins/controllers/actions/ipaddress/GetPoolsAction.scala @@ -53,7 +53,7 @@ case class GetPoolsAction( protected def toJsonList(pools: Set[AddressPool]): JsArray = JsArray( pools.toList.map { pool => val seq = Seq( - "NAME" -> JsString(convertPoolName(pool.name, true)), + "NAME" -> JsString(convertPoolName(pool.name)), "NETWORK" -> JsString(formatNetworkAddress(pool.network)), "START_ADDRESS" -> JsString(pool.startAddress.getOrElse("Unspecified")), "SPECIFIED_GATEWAY" -> JsString(pool.gateway.getOrElse("Unspecified")),