Updates to maintenance script for EBS compatibility

add-new-regnum-params
Mike Benowitz 2019-07-08 12:18:37 -04:00
parent c1e7fa936c
commit 386a8515a7
3 changed files with 11 additions and 8 deletions

6
.gitignore vendored
View File

@ -2,4 +2,8 @@
config.yaml
*.pyc
*.xml
*.code-workspace
*.code-workspace
# Elastic Beanstalk Files
.elasticbeanstalk/*
!.elasticbeanstalk/*.cfg.yml
!.elasticbeanstalk/*.global.yml

View File

@ -77,7 +77,10 @@ def loadConfig():
if __name__ == '__main__':
args = parseArgs()
loadConfig()
try:
loadConfig()
except FileNotFoundError:
pass
main(
secondsAgo=args.time,
year=args.year,

View File

@ -45,9 +45,7 @@ class Renewal(BaseDoc):
claimants = Nested(Claimant)
class Index:
with open('config.yaml', 'r') as yamlFile:
config = yaml.safe_load(yamlFile)
name = config['ELASTICSEARCH']['ES_CCR_INDEX']
name = os.environ['ES_CCR_INDEX']
class CCE(BaseDoc):
@ -60,6 +58,4 @@ class CCE(BaseDoc):
registrations = Nested(Registration)
class Index:
with open('config.yaml', 'r') as yamlFile:
config = yaml.safe_load(yamlFile)
name = config['ELASTICSEARCH']['ES_CCE_INDEX']
name = os.environ['ES_CCE_INDEX']