From c3279a4741cdfce89c0e4caff095968f74ff9086 Mon Sep 17 00:00:00 2001 From: Björn Hagemeister Date: Mon, 20 Oct 2014 16:25:27 +0200 Subject: Implemented registerSatellite without neccessary valid session. --- .../satellitedaemon/filetransfer/ThriftConnection.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/openslx/satellitedaemon/filetransfer/ThriftConnection.java b/src/main/java/org/openslx/satellitedaemon/filetransfer/ThriftConnection.java index 0502768..c52b45b 100644 --- a/src/main/java/org/openslx/satellitedaemon/filetransfer/ThriftConnection.java +++ b/src/main/java/org/openslx/satellitedaemon/filetransfer/ThriftConnection.java @@ -289,8 +289,17 @@ public class ThriftConnection */ public static boolean registerSatellite( String organizationId, String ipAddress, String modulus, String exponent ) { - ImageServer.Client theClient = null; - theClient = getConnection(); + ImageServer.Client theClient = client.get(); + + if ( theClient == null ) { + // There is no client instance for this thread, create a new one + log.info( "No existing client for this thread. Making a new client ..." ); + theClient = newClient(); + if ( theClient == null ) { + log.debug( "The client was null after newClient()" ); + return false; + } + } // No check for valid connection. --> not needed, because this satellite is not known yet by master. try { return theClient.registerSatellite( organizationId, ipAddress, modulus, exponent ); -- cgit v1.2.3-55-g7522