Issue #1150: Fix regression caused by previous text product generation changes by ensuring all

directories get created.

Change-Id: I855b4afcc02e8b7c9e7f4d70b1a7ba3d449ff3c0

Former-commit-id: f192c8d115 [formerly f192c8d115 [formerly 74e7d98c5bde7cefaedf354ecfbac147b2ff801a]]
Former-commit-id: 83681d1ff6
Former-commit-id: 9d13d3244d
This commit is contained in:
David Gillingham 2012-09-07 12:29:36 -05:00
parent aed0c142c3
commit 7bb5d95ac5
2 changed files with 20 additions and 6 deletions

View file

@ -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

View file

@ -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.
*
* </pre>
*
@ -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;
}