Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix setting value to engine-config properties #789

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ public void scheduleJob() {
}

private void checkExecutionTimeStamp() {
log.debug("Started AnsibleRunnerCleanUp Service");
int artifactsLifeTime = Config.<Integer> getValue(ConfigValues.AnsibleRunnerArtifactsLifetimeInDays);
Stream.of(new File(AnsibleConstants.ANSIBLE_RUNNER_PATH.toString()).listFiles()).forEach(file -> {
log.debug("Evaluating if '{}' should be removed", file.getAbsolutePath());
long creationInDays;
try {
creationInDays = Files.readAttributes(file.toPath(), BasicFileAttributes.class)
Expand All @@ -60,6 +62,7 @@ private void checkExecutionTimeStamp() {
}
long todayInDays = FileTime.fromMillis(new Date().getTime()).to(TimeUnit.DAYS);
if (todayInDays - creationInDays > artifactsLifeTime) {
log.debug("Deleting directory '{}'", file.getAbsolutePath());
try {
Files.walk(Paths.get(file.getAbsolutePath()))
.sorted(Comparator.reverseOrder())
Expand All @@ -71,5 +74,6 @@ private void checkExecutionTimeStamp() {
}
}
});
log.debug("Finished AnsibleRunnerCleanUp Service");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public ConfigKey generateByPropertiesKey(String key) {
if (StringUtils.isBlank(type)) {
type = "String";
}
String[] validValues = node.findValuesAsText("validValues").toArray(new String[0]);

String[] validValues = node.findValuesAsText("validValues").get(0).split(",");
// Description containing the list delimiter *will* be broken into an array, so rejoin it using that delimiter.
// We pad the separator because the strings in the array are trimmed automatically.
String description = node.get("description").asText();
Expand Down