Skip to content

Commit 40fd1ed

Browse files
author
Vince Kraemer
committed
first pass for Tom to look at
1 parent cc40803 commit 40fd1ed

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

operator/src/main/resources/scripts/introspectDomain.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -878,6 +878,19 @@ def generateAndValidate(self):
878878
if not os.path.exists(self.env.CUSTOM_SITCFG_PATH):
879879
return
880880

881+
# We expect the user to include a 'version.txt' file in their situational
882+
# config directory.
883+
#
884+
# That file is expected to contain '2.0'
885+
#
886+
versionPath=os.path.join(self.env.CUSTOM_SITCFG_PATH,"version.txt")
887+
if not os.path.exists(versionPath):
888+
self.env.addError("Error, Required file, "+versionPath+", does not exist")
889+
else:
890+
version=self.env.readFile(versionPath).strip()
891+
if not version == "2.0":
892+
self.env.addError("Error, "+versionPath+" does not have the value of '2.0'.")
893+
881894
for the_file in os.listdir(self.env.CUSTOM_SITCFG_PATH):
882895

883896
the_file_path = os.path.join(self.env.CUSTOM_SITCFG_PATH, the_file)
@@ -889,7 +902,7 @@ def generateAndValidate(self):
889902

890903
# check if file name corresponds with config.xml or a module
891904

892-
if not self.moduleMap.has_key(the_file) and the_file != "config.xml":
905+
if not self.moduleMap.has_key(the_file) and the_file != "config.xml" and the_file != "version.txt":
893906
self.env.addError("Error, custom sit config override file '" + the_file + "'"
894907
+ " is not named 'config.xml' or has no matching system resource"
895908
+ " module. Custom sit config files must be named 'config.xml'"
@@ -914,6 +927,8 @@ def generateAndValidate(self):
914927

915928
if the_file == 'config.xml':
916929
genfile += self.env.CUSTOM_PREFIX_CFG + 'custom-situational-config.xml'
930+
elif the_file == 'version.txt':
931+
genfile += self.env.CUSTOM_PREFIX_CFG + 'version.txt'
917932
else:
918933
genfile += self.moduleMap[the_file]
919934

0 commit comments

Comments
 (0)