From 5704488cc59fdc8397318a256522c5ad83c5255c Mon Sep 17 00:00:00 2001 From: "kirby@puppetlabs.com" Date: Wed, 3 Oct 2018 13:07:20 -0700 Subject: [PATCH] (POOLER-132) Sync pool size on dashboard start This commit updates the dashboard for vmpooler to ensure it is synchronized with any redis based configuration values before displaying the dashboard. Without this change the pool size value may be displayed incorrectly if the value has been set via the /config/poolsize API endpoint. --- CHANGELOG.md | 3 +++ lib/vmpooler/api.rb | 4 ---- lib/vmpooler/api/v1.rb | 5 +++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 66627ad..d8141a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,9 @@ If you're looking for changes from before this, refer to the project's git logs & PR history. # [Unreleased](https://github.com/puppetlabs/vmpooler/compare/0.2.2...master) +### Fixed +- Sync pool size before dashboard is displayed (POOLER-132) + # [0.2.2](https://github.com/puppetlabs/vmpooler/compare/0.2.1...0.2.2) ### Fixed diff --git a/lib/vmpooler/api.rb b/lib/vmpooler/api.rb index a9a9e83..239155b 100644 --- a/lib/vmpooler/api.rb +++ b/lib/vmpooler/api.rb @@ -14,10 +14,6 @@ module Vmpooler JSON.pretty_generate(result) end - get '/' do - redirect to('/dashboard/') - end - # Load dashboard components begin require 'dashboard' diff --git a/lib/vmpooler/api/v1.rb b/lib/vmpooler/api/v1.rb index 640a8f9..00497a1 100644 --- a/lib/vmpooler/api/v1.rb +++ b/lib/vmpooler/api/v1.rb @@ -211,6 +211,11 @@ module Vmpooler end end + get '/' do + sync_pool_sizes + redirect to('/dashboard/') + end + # Provide run-time statistics # # Example: