@@ -878,6 +878,19 @@ def generateAndValidate(self):
878
878
if not os .path .exists (self .env .CUSTOM_SITCFG_PATH ):
879
879
return
880
880
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
+
881
894
for the_file in os .listdir (self .env .CUSTOM_SITCFG_PATH ):
882
895
883
896
the_file_path = os .path .join (self .env .CUSTOM_SITCFG_PATH , the_file )
@@ -889,7 +902,7 @@ def generateAndValidate(self):
889
902
890
903
# check if file name corresponds with config.xml or a module
891
904
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" :
893
906
self .env .addError ("Error, custom sit config override file '" + the_file + "'"
894
907
+ " is not named 'config.xml' or has no matching system resource"
895
908
+ " module. Custom sit config files must be named 'config.xml'"
@@ -914,6 +927,8 @@ def generateAndValidate(self):
914
927
915
928
if the_file == 'config.xml' :
916
929
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'
917
932
else :
918
933
genfile += self .moduleMap [the_file ]
919
934
0 commit comments