From 1571b9a8eb154906801635f5ddf3e5420c1fc131 Mon Sep 17 00:00:00 2001 From: Ron Anderson Date: Thu, 20 Feb 2014 09:34:18 -0600 Subject: [PATCH] Issue #2824 Fix localVTECpartners include directory. Add logging to help determine when local overrides are not being used Change-Id: I9a100fe3b1a9c8dc94639029d6380f36f5ba4da7 Former-commit-id: 6b6aa14e59243037e1ba8358f20817504600a201 [formerly 37a420582eea8d3a1b4861e18c20d044c636173f] Former-commit-id: 08a1be844d832e93fe519efb0bbe041d1b7952ab --- .../gfe/config/IFPServerConfigManager.java | 25 +++++++++++-------- .../edex_static/base/config/gfe/Maps.py | 15 +++++++++-- .../base/config/gfe/serverConfig.py | 5 +++- .../vtecsharing/FetchActiveTableSrv.java | 5 ++-- .../common_static/base/vtec/VTECPartners.py | 6 +++-- 5 files changed, 39 insertions(+), 17 deletions(-) diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/config/IFPServerConfigManager.java b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/config/IFPServerConfigManager.java index 7580b04d3b..3449230837 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/config/IFPServerConfigManager.java +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/config/IFPServerConfigManager.java @@ -46,17 +46,19 @@ import com.raytheon.uf.common.util.FileUtil; /** * Manages the serverConfigs of active sites - * + * *
- *
+ * 
  * SOFTWARE HISTORY
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Jul 9, 2009            njensen     Initial creation
  * Dec 11, 2012 14360     ryu         Throw specific exception for missing configuration.
- *
+ * Feb 20, 2014 #2824     randerso    Fixed import of localVTECPartners to use siteID
+ *                                    Added common python path for LogStream
+ * 
  * 
- * + * * @author njensen * @version 1.0 */ @@ -74,7 +76,7 @@ public class IFPServerConfigManager { /** * Returns the sites that have active configurations - * + * * @return */ protected static Set getActiveSites() { @@ -83,7 +85,7 @@ public class IFPServerConfigManager { /** * Gets the server configuration for a particular site - * + * * @param siteID * the site * @return the site's configuration @@ -102,7 +104,7 @@ public class IFPServerConfigManager { /** * Initializes a site's serverConfig by reading in the site's localConfig - * + * * @param siteID * the site * @return the site's configuration @@ -163,12 +165,15 @@ public class IFPServerConfigManager { } siteDir = siteDirFile.getPath(); - String vtecPath = GfePyIncludeUtil.getVtecIncludePath(); + String commonPythonPath = GfePyIncludeUtil.getCommonPythonIncludePath(); + + String vtecPath = GfePyIncludeUtil.getVtecIncludePath(siteID); PythonScript py = null; try { py = new PythonScript(FileUtil.join(baseDir, "wrapper.py"), - PyUtil.buildJepIncludePath(siteDir, baseDir, vtecPath), + PyUtil.buildJepIncludePath(siteDir, baseDir, + commonPythonPath, vtecPath), IFPServerConfig.class.getClassLoader()); SimpleServerConfig simpleConfig = (SimpleServerConfig) py.execute( "getSimpleConfig", null); @@ -188,7 +193,7 @@ public class IFPServerConfigManager { /** * Removes a site's configuration from the set of active configurations - * + * * @param siteID */ protected static void removeSite(String siteID) { diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/config/gfe/Maps.py b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/config/gfe/Maps.py index e9adf4e100..c5170ae9d1 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/config/gfe/Maps.py +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/config/gfe/Maps.py @@ -20,8 +20,18 @@ # NOTE: THIS FILE SHOULD NOT BE USER_MODIFIED. INSTEAD, REFER TO THE # DOCUMENTATION ON HOW ENTRIES IN THIS FILE MAY BE OVERRIDDEN. REFER TO # LOCALMAPS DOCUMENTATION. - +# # Maps.py - map background definitions for ifpServer +# +# ---------------------------------------------------------------------------- +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 02/20/2014 #2824 randerso Added log message when no localMaps file is found +# +######################################################################## from ShapeTable import ShapeTable @@ -311,7 +321,8 @@ if not BASELINE: try: from localMaps import * except ImportError: - pass + import LogStream + LogStream.logEvent("No localMaps file found, using baseline settings."); def getMaps(): from java.util import ArrayList diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/config/gfe/serverConfig.py b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/config/gfe/serverConfig.py index fc669bf35e..dd10cdfd9e 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/config/gfe/serverConfig.py +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/config/gfe/serverConfig.py @@ -33,8 +33,9 @@ # 08/09/2013 #1571 randerso Changed projections to use the Java # ProjectionType enumeration # 10/03/2013 #2418 dgilling Update for new pSurge 2.0 data. -# 10/03/2013 2424 randerso Change localTC to use dateutil instead of pytz +# 10/03/2013 #2424 randerso Change localTC to use dateutil instead of pytz # to get correct offsets for Alaska +# 02/20/2014 #2824 randerso Added log message when local override files are not found # ######################################################################## @@ -57,6 +58,8 @@ def siteImport(modName): if fp: fp.close() except ImportError: + import LogStream + LogStream.logEvent("No " + modName + " file found, using baseline settings."); return 0 globals()[modName] = __import__(modName) return 1 diff --git a/edexOsgi/com.raytheon.uf.edex.activetable/src/com/raytheon/uf/edex/activetable/vtecsharing/FetchActiveTableSrv.java b/edexOsgi/com.raytheon.uf.edex.activetable/src/com/raytheon/uf/edex/activetable/vtecsharing/FetchActiveTableSrv.java index f39b61e522..93cf8667d2 100644 --- a/edexOsgi/com.raytheon.uf.edex.activetable/src/com/raytheon/uf/edex/activetable/vtecsharing/FetchActiveTableSrv.java +++ b/edexOsgi/com.raytheon.uf.edex.activetable/src/com/raytheon/uf/edex/activetable/vtecsharing/FetchActiveTableSrv.java @@ -49,7 +49,8 @@ import com.raytheon.uf.edex.site.ISiteActivationListener; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Feb 28, 2013 dgilling Initial creation + * Feb 28, 2013 dgilling Initial creation + * Feb 20, 2014 #2824 randerso Changed log level of message when activating FetchAT * * * @@ -80,7 +81,7 @@ public class FetchActiveTableSrv implements ISiteActivationListener { FetchATJobConfig config = new FetchATJobConfig(configData); final String site = config.getSiteId(); - statusHandler.debug("Activating FetchAT for " + site); + statusHandler.info("Activating FetchAT for " + site); statusHandler.debug("Site: " + site + " config: " + config); if ((siteConfigMap.containsKey(site)) diff --git a/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/VTECPartners.py b/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/VTECPartners.py index ac11e1b11d..5011ab9aac 100644 --- a/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/VTECPartners.py +++ b/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/VTECPartners.py @@ -26,6 +26,7 @@ # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 06/11/13 #2083 randerso Fixed getISCSites to look in configured +# 02/20/2014 #2824 randerso Added log message when no localVTECPartners file is found #VTEC_Partners.py - configuration file to control filtering and merging #of VTEC active table. @@ -298,5 +299,6 @@ except: #allow overrides try: from localVTECPartners import * -except: - pass +except ImportError: + import LogStream + LogStream.logEvent("No localVTECPartners file found, using baseline settings.");