From 4dbddc48ae1c4226c48c2ce479d89a6c80ac36e9 Mon Sep 17 00:00:00 2001
From: Auke Klazema <klazema@astron.nl>
Date: Wed, 27 Feb 2019 13:44:28 +0000
Subject: [PATCH] SW-596: Fix a scope issue

---
 MAC/APL/MainCU/src/MACScheduler/MACScheduler.cc | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/MAC/APL/MainCU/src/MACScheduler/MACScheduler.cc b/MAC/APL/MainCU/src/MACScheduler/MACScheduler.cc
index e6db8eae9b4..d5f8e03de31 100644
--- a/MAC/APL/MainCU/src/MACScheduler/MACScheduler.cc
+++ b/MAC/APL/MainCU/src/MACScheduler/MACScheduler.cc
@@ -252,9 +252,10 @@ GCFEvent::TResult MACScheduler::initial_state(GCFEvent& event, GCFPortInterface&
 
 		// Try to connect to the SAS database.
 		ParameterSet* pParamSet = globalParameterSet();
+        std::string username;
         try
         {
-            string username = pParamSet->getString("OTDBusername");
+            username = pParamSet->getString("OTDBusername");
         }
         catch(LOFAR::APSException& ex)
         {
@@ -263,9 +264,10 @@ GCFEvent::TResult MACScheduler::initial_state(GCFEvent& event, GCFPortInterface&
                           << ex.what());
             throw(ex);
         }
+        std::string DBname;
         try
         {
-            string DBname = pParamSet->getString("OTDBdatabasename");
+            DBname = pParamSet->getString("OTDBdatabasename");
         }
         catch(LOFAR::APSException& ex)
         {
@@ -274,9 +276,10 @@ GCFEvent::TResult MACScheduler::initial_state(GCFEvent& event, GCFPortInterface&
                           << ex.what());
             throw(ex);
         }
+        std::string password;
         try
         {
-          string password = pParamSet->getString("OTDBpassword");
+            password = pParamSet->getString("OTDBpassword");
         }
         catch(LOFAR::APSException& ex)
         {
@@ -285,9 +288,10 @@ GCFEvent::TResult MACScheduler::initial_state(GCFEvent& event, GCFPortInterface&
                           << ex.what());
             throw(ex);
         }
+        std::string hostname
         try
         {
-            string hostname = pParamSet->getString("OTDBhostname");
+            hostname = pParamSet->getString("OTDBhostname");
         }
         catch(LOFAR::APSException& ex)
         {
@@ -296,9 +300,10 @@ GCFEvent::TResult MACScheduler::initial_state(GCFEvent& event, GCFPortInterface&
                           << ex.what());
             throw(ex);
         }
+        std::string port;
         try
         {
-            string port = pParamSet->getString("OTDBport");
+            port = pParamSet->getString("OTDBport");
         }
         catch(LOFAR::APSException& ex)
         {
-- 
GitLab