X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fnetconf-ssh%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fssh%2Fosgi%2FNetconfSSHActivator.java;h=fa87b73fad2b10bc977f0d88134c1fe21f5fb676;hb=7b0dffb2ac7d8537a29cb8db599c03e1103bb593;hp=23c92e86488b06d31ae9d15bd4af91eaea06c987;hpb=f3473ee42d45f1524dcafa6cc37e19e0393e9693;p=controller.git diff --git a/opendaylight/netconf/netconf-ssh/src/main/java/org/opendaylight/controller/netconf/ssh/osgi/NetconfSSHActivator.java b/opendaylight/netconf/netconf-ssh/src/main/java/org/opendaylight/controller/netconf/ssh/osgi/NetconfSSHActivator.java index 23c92e8648..fa87b73fad 100644 --- a/opendaylight/netconf/netconf-ssh/src/main/java/org/opendaylight/controller/netconf/ssh/osgi/NetconfSSHActivator.java +++ b/opendaylight/netconf/netconf-ssh/src/main/java/org/opendaylight/controller/netconf/ssh/osgi/NetconfSSHActivator.java @@ -19,7 +19,6 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ThreadFactory; -import org.apache.commons.io.FilenameUtils; import org.apache.sshd.common.util.ThreadUtils; import org.apache.sshd.server.keyprovider.PEMGeneratorHostKeyProvider; import org.opendaylight.controller.netconf.ssh.SshProxyServer; @@ -85,7 +84,7 @@ public class NetconfSSHActivator implements BundleActivator { private SshProxyServer startSSHServer(final BundleContext bundleContext) throws IOException { final Optional maybeSshSocketAddress = NetconfConfigUtil.extractNetconfServerAddress(bundleContext, InfixProp.ssh); - if (maybeSshSocketAddress.isPresent() == false) { + if (!maybeSshSocketAddress.isPresent()) { LOG.trace("SSH bridge not configured"); return null; } @@ -97,7 +96,8 @@ public class NetconfSSHActivator implements BundleActivator { authProviderTracker = new AuthProviderTracker(bundleContext); - final String path = FilenameUtils.separatorsToSystem(NetconfConfigUtil.getPrivateKeyPath(bundleContext)); + final String path = NetconfConfigUtil.getPrivateKeyPath(bundleContext); + checkState(!Strings.isNullOrEmpty(path), "Path to ssh private key is blank. Reconfigure %s", NetconfConfigUtil.getPrivateKeyKey());