awslabs/amazon-redshift-utils

Support local config file in WorkloadManagementScheduler

cibinmathew opened this issue · 0 comments

Feature Request
In WorkloadManagementScheduler/wlm_scheduler.py
Currently both inplace configuration and json files stored in s3 are supported.
Additionally add support for local json file stored in lambda's code dir.

if CONFIG_KEY in ruleset and isinstance(ruleset[CONFIG_KEY], list):
wlm_config = json.dumps(ruleset[CONFIG_KEY])
elif CONFIG_KEY in ruleset and isinstance(ruleset[CONFIG_KEY], basestring):
if ruleset[CONFIG_KEY].startswith('s3://'):
wlm_config = json.dumps(get_file_contents(ruleset[CONFIG_KEY], region_name))
else:
raise Exception(
"Malformed Configuration for Ruleset %s. '%s' must be a json based WLM configuration or an S3 file location" % (