Skip to content

Commit

Permalink
Flavor is sorted by cpu, ram, disk as opposed to name
Browse files Browse the repository at this point in the history
  • Loading branch information
Kishorekumar Neelamegam committed Apr 25, 2017
1 parent fc6b95e commit 6d7da28
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/admin/Flavors.scala
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ object Flavors extends ConcreteFlavors {
new ResourceItemNotFound("", "Flavor items = nothing found.")
}).toValidationNel.flatMap { nm: Seq[FlavorResult] =>
if (!nm.isEmpty) {
Validation.success[Throwable, Seq[FlavorResult]](nm.sortWith(_.name < _.name).sortWith(_.cpu < _.cpu)).toValidationNel
Validation.success[Throwable, Seq[FlavorResult]](nm.sortWith(_.cpu.toInt < _.cpu.toInt).sortWith(_.ram.toInt < _.ram.toInt).sortWith(_.disk.toInt < _.disk.toInt)).toValidationNel

} else {
Validation.failure[Throwable, Seq[FlavorResult]](new ResourceItemNotFound("", "Flavor = nothing found.")).toValidationNel
Expand Down

0 comments on commit 6d7da28

Please sign in to comment.