Merged in issue-1 (pull request #15)

Resolve issue #2
This commit is contained in:
Mark Nellemann 2021-03-19 19:50:16 +00:00
commit f27df59380
4 changed files with 14 additions and 6 deletions

View File

@ -107,7 +107,7 @@ Use the gradle build tool, which will download all required dependencies:
Start the InfluxDB container:
docker run --name=influxdb --rm -d -p 8086:8086 influxdb
docker run --name=influxdb --rm -d -p 8086:8086 influxdb:1.8-alpine
To execute the Influx client from within the container:

View File

@ -19,7 +19,7 @@ dependencies {
annotationProcessor 'info.picocli:picocli-codegen:4.6.1'
implementation 'info.picocli:picocli:4.6.1'
implementation 'org.jsoup:jsoup:1.13.1'
implementation 'com.squareup.okhttp3:okhttp:4.9.0'
implementation 'com.squareup.okhttp3:okhttp:4.9.1'
implementation 'com.squareup.moshi:moshi:1.11.0'
implementation 'com.serjltt.moshi:moshi-lazy-adapters:2.2'
implementation 'org.tomlj:tomlj:1.0.0'
@ -27,9 +27,9 @@ dependencies {
implementation 'org.slf4j:slf4j-api:1.7.30'
implementation 'org.slf4j:slf4j-simple:1.7.30'
testImplementation('org.spockframework:spock-core:2.0-M4-groovy-3.0')
testImplementation('com.squareup.okhttp3:mockwebserver:4.9.0')
testImplementation("org.slf4j:slf4j-simple:1.7.+")
testImplementation 'org.spockframework:spock-core:2.0-M4-groovy-3.0'
testImplementation 'com.squareup.okhttp3:mockwebserver:4.9.1'
testImplementation "org.slf4j:slf4j-simple:1.7.30"
}
application {

View File

@ -19,6 +19,7 @@ import biz.nellemann.hmci.Configuration.HmcObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.time.Duration;
import java.time.Instant;
import java.util.HashMap;
@ -108,6 +109,13 @@ class HmcInstance implements Runnable {
} while (keepRunning.get());
// Logout of HMC
try {
hmcRestClient.logoff();
} catch (IOException e) {
log.warn("run() - error logging out: " + e.getMessage());
}
}
@ -118,7 +126,6 @@ class HmcInstance implements Runnable {
Map<String, LogicalPartition> tmpPartitions = new HashMap<>();
try {
hmcRestClient.logoff();
hmcRestClient.login();
hmcRestClient.getManagedSystems().forEach((systemId, system) -> {

View File

@ -86,6 +86,7 @@ public class HmcRestClient {
synchronized void login() throws Exception {
log.debug("Connecting to HMC - " + baseUrl);
logoff();
StringBuilder payload = new StringBuilder();
payload.append("<?xml version='1.0' encoding='UTF-8' standalone='yes'?>");