Skip to content

Commit

Permalink
Merge pull request #61 from uclahs-cds/nwiltsie-def-everything
Browse files Browse the repository at this point in the history
Add defs to incorrectly-global variables
  • Loading branch information
nwiltsie authored Mar 11, 2024
2 parents 3ec7186 + 7162c74 commit f3448ac
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

### Changed
- Allow `set_resources_allocation` to use maximum allocation values defined in params
- Add `def`s to multiple variables that should not be globally defined

---

Expand Down
2 changes: 1 addition & 1 deletion config/retry/retry.config
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ retry {
def proc_params = [:]
for (i in process) {
if (i.key.startsWith('withName:')) {
proc_names = i.key.split('withName:')[1].split("\\|")
def proc_names = i.key.split('withName:')[1].split("\\|")
for (proc_name in proc_names) {
proc_params = [:]
for (j in i.value) {
Expand Down
6 changes: 3 additions & 3 deletions config/schema/schema.config
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ schema {
load_schema = { String file_path ->
def schema_file = new File(file_path)
Yaml parser = new Yaml()
yaml = parser.load(schema_file.text)
def yaml = parser.load(schema_file.text)
return yaml
}

Expand Down Expand Up @@ -244,7 +244,7 @@ schema {
* Main validation to call, to validate the params from config file(s) against the schema.
*/
validate = { String file_path="${projectDir}/config/schema.yaml" ->
params_schema = schema.load_schema(file_path)
def params_schema = schema.load_schema(file_path)
params_schema.each { key, val ->
schema.validate_parameter(params, key, val)
}
Expand All @@ -257,7 +257,7 @@ schema {
* keys_to_exclude: params to skip during validation
*/
validate_specific = { String file_path, Map params_to_validate, List keys_to_exclude=[] ->
params_schema = schema.load_schema(file_path)
def params_schema = schema.load_schema(file_path)
params_schema.removeAll{ key, val -> keys_to_exclude.contains(key) }
params_schema.each { key, val ->
schema.validate_parameter(params_to_validate, key, val)
Expand Down

0 comments on commit f3448ac

Please sign in to comment.