BUG-8203: update Netty isRoot method name 51/54751/1
authorClaudio D. Gasparini <claudio.gasparini@pantheon.tech>
Tue, 11 Apr 2017 08:49:32 +0000 (10:49 +0200)
committerClaudio D. Gasparini <claudio.gasparini@pantheon.tech>
Tue, 11 Apr 2017 08:51:36 +0000 (10:51 +0200)
Netty has changed the name of the method isRoot
to maybeSuperUser.

Change-Id: Id2a5c19d914cccd5e3581a3ca59846d113ecaeb0
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
bgp/bmp-impl/src/main/java/org/opendaylight/controller/config/yang/bmp/impl/BmpMonitorImplModule.java
bgp/rib-impl/src/main/java/org/opendaylight/controller/config/yang/bgp/rib/impl/BGPPeerAcceptorModule.java
bgp/rib-impl/src/test/java/org/opendaylight/controller/config/yang/bgp/rib/impl/BGPPeerAcceptorModuleTest.java

index 66c144c1b85b9b8da490f860a7e5219d92b17c90..6f9c90f3d2c40b0032337e3b40cc568611db4cde 100644 (file)
@@ -76,7 +76,7 @@ public class BmpMonitorImplModule extends org.opendaylight.controller.config.yan
     public void customValidation() {
         JmxAttributeValidationException.checkNotNull(getBindingPort(), bindingPortJmxAttribute);
         // check if unix root user
-        if (!PlatformDependent.isWindows() && !PlatformDependent.isRoot() && getBindingPort().getValue() < PRIVILEGED_PORTS) {
+        if (!PlatformDependent.isWindows() && !PlatformDependent.maybeSuperUser() && getBindingPort().getValue() < PRIVILEGED_PORTS) {
             throw new AccessControlException("Unable to bind port " + getBindingPort().getValue() + " while running as non-root user.");
         }
     }
index 8b207612115c2c43585b3da51dba66f1c8ca07e6..70423c8c6989abcd2f45cb607810fc435688ab7e 100644 (file)
@@ -45,7 +45,7 @@ public class BGPPeerAcceptorModule extends org.opendaylight.controller.config.ya
     @Override
     public void customValidation() {
         // check if unix root user
-        if (!PlatformDependent.isWindows() && !PlatformDependent.isRoot() && getBindingPort().getValue() < PRIVILEGED_PORTS) {
+        if (!PlatformDependent.isWindows() && !PlatformDependent.maybeSuperUser() && getBindingPort().getValue() < PRIVILEGED_PORTS) {
             throw new AccessControlException("Unable to bind port " + getBindingPort().getValue() + " while running as non-root user.");
         }
         // Try to parse address
index 6decf52f34a4ac26bc855c1411ccb9d7aeb77976..77d1a4c35a0181e0d6b088a7da7170e24e7999db 100644 (file)
@@ -67,7 +67,7 @@ public class BGPPeerAcceptorModuleTest extends AbstractRIBImplModuleTest {
             assertStatus(status, 3, 0, 0);
             verify(dispatcher).createServer(any(BGPPeerRegistry.class), any(InetSocketAddress.class));
         } catch (final ValidationException e) {
-            if(!PlatformDependent.isWindows() && !PlatformDependent.isRoot()) {
+            if(!PlatformDependent.isWindows() && !PlatformDependent.maybeSuperUser()) {
                 Assert.assertTrue(e.getMessage().contains("Unable to bind port"));
             } else {
                 fail();