diff --git a/edexOsgi/build.edex/esb/data/utility/edex_static/base/textproducts/Generator.py b/edexOsgi/build.edex/esb/data/utility/edex_static/base/textproducts/Generator.py index 7be3c78550..f15ea5c911 100755 --- a/edexOsgi/build.edex/esb/data/utility/edex_static/base/textproducts/Generator.py +++ b/edexOsgi/build.edex/esb/data/utility/edex_static/base/textproducts/Generator.py @@ -32,11 +32,13 @@ Jul 08, 2008 1222 jelkins Modified for use within Java Jul 09, 2008 1222 jelkins Split command line loader from class Jul 24, 2012 #944 dgilling Refactored to support separate generation of products and utilities. +Sep 07, 2012 #1150 dgilling Ensure all necessary dirs get created. @author: jelkins """ __version__ = "1.0" +import errno import os from os.path import basename from os.path import join @@ -129,14 +131,13 @@ class Generator(): @type value: string @raise IOError: when the directory does not exist or is not writable - """ - - from os import makedirs + """ try: - makedirs(value,0755) + os.makedirs(value, 0755) except OSError, e: - LOG.warn("%s: '%s'" % (e.strerror,e.filename)) + if e.errno != errno.EEXIST: + LOG.warn("%s: '%s'" % (e.strerror,e.filename)) self.__destination = value @@ -497,6 +498,13 @@ class Generator(): """ LOG.debug("Processing Formatter Templates.......") + try: + os.makedirs(join(self.getDestination(), destDir)) + except OSError, e: + if e.errno != errno.EEXIST: + LOG.error("%s: '%s'" % (e.strerror,e.filename)) + return 0 + siteid = self.__siteId productsWritten = 0 diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/textproducts/Configurator.java b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/textproducts/Configurator.java index 7fa29754f0..253143435d 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/textproducts/Configurator.java +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/textproducts/Configurator.java @@ -62,6 +62,8 @@ import com.raytheon.uf.edex.database.cluster.ClusterTask; * Jul 7, 2008 1222 jelkins Initial creation * Jul 24,2012 #944 dgilling Fix text product template generation * to create textProducts and textUtilities. + * Sep 07,2012 #1150 dgilling Fix isConfigured to check for textProducts + * and textUtilities dirs. * * * @@ -158,7 +160,11 @@ public class Configurator { task.getLastExecution(), true); // if the destination dir does not exist, configurator needs run - if (!new File(destinationDirectory).exists()) { + + if ((!new File(FileUtil.join(destinationDirectory, "textProducts")) + .isDirectory()) + || (!new File(FileUtil.join(destinationDirectory, + "textUtilities")).isDirectory())) { filesHaveChanges = true; }