Fix indentation issues in code and properties file. Project: http://git-wip-us.apache.org/repos/asf/airavata/repo Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/de05f6b4 Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/de05f6b4 Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/de05f6b4
Branch: refs/heads/develop Commit: de05f6b45c2b60d9e8254d90a9b43df87afd59df Parents: 45adf30 Author: Gourav Shenoy <[email protected]> Authored: Fri Apr 22 15:33:47 2016 -0400 Committer: Gourav Shenoy <[email protected]> Committed: Fri Apr 22 15:33:47 2016 -0400 ---------------------------------------------------------------------- .../airavata/cloud/intf/CloudInterface.java | 16 +++++----- .../cloud/intf/impl/OpenstackIntfImpl.java | 32 ++++++++++---------- .../apache/airavata/cloud/util/Constants.java | 16 +++++----- .../main/resources/jetstream_openrc.properties | 4 +-- .../airavata/cloud/test/CloudIntfTest.java | 24 +++++++-------- .../src/test/resources/test_data.properties | 2 +- 6 files changed, 47 insertions(+), 47 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/airavata/blob/de05f6b4/modules/cloud/cloud-provisioning/src/main/java/org/apache/airavata/cloud/intf/CloudInterface.java ---------------------------------------------------------------------- diff --git a/modules/cloud/cloud-provisioning/src/main/java/org/apache/airavata/cloud/intf/CloudInterface.java b/modules/cloud/cloud-provisioning/src/main/java/org/apache/airavata/cloud/intf/CloudInterface.java index 9d0fc5e..5c3893c 100644 --- a/modules/cloud/cloud-provisioning/src/main/java/org/apache/airavata/cloud/intf/CloudInterface.java +++ b/modules/cloud/cloud-provisioning/src/main/java/org/apache/airavata/cloud/intf/CloudInterface.java @@ -82,7 +82,7 @@ public interface CloudInterface { * @param serverId the server id */ public void addFloatingIP(String serverId); - + /** * Creates the router. * @@ -91,7 +91,7 @@ public interface CloudInterface { * @return the object */ public Object createRouter(String routerName, String externalGatewayName); - + /** * Creates the subnet. * @@ -102,7 +102,7 @@ public interface CloudInterface { * @return the object */ public Object createSubnet(String subnetName, String networkName, String subnetCIDR, int ipVersion); - + /** * Creates the network. * @@ -110,7 +110,7 @@ public interface CloudInterface { * @return the object */ public Object createNetwork(String networkName); - + /** * Creates the router subnet interface. * @@ -119,7 +119,7 @@ public interface CloudInterface { * @return the object */ public Object createRouterSubnetInterface(String routerName, String subnetName); - + /** * Delete router subnet interface. * @@ -127,21 +127,21 @@ public interface CloudInterface { * @param subnetName the subnet name */ public void deleteRouterSubnetInterface(String routerName, String subnetName); - + /** * Delete subnet. * * @param subnetName the subnet name */ public void deleteSubnet(String subnetName); - + /** * Delete router. * * @param routerName the router name */ public void deleteRouter(String routerName); - + /** * Delete network. * http://git-wip-us.apache.org/repos/asf/airavata/blob/de05f6b4/modules/cloud/cloud-provisioning/src/main/java/org/apache/airavata/cloud/intf/impl/OpenstackIntfImpl.java ---------------------------------------------------------------------- diff --git a/modules/cloud/cloud-provisioning/src/main/java/org/apache/airavata/cloud/intf/impl/OpenstackIntfImpl.java b/modules/cloud/cloud-provisioning/src/main/java/org/apache/airavata/cloud/intf/impl/OpenstackIntfImpl.java index 109df9d..650f491 100644 --- a/modules/cloud/cloud-provisioning/src/main/java/org/apache/airavata/cloud/intf/impl/OpenstackIntfImpl.java +++ b/modules/cloud/cloud-provisioning/src/main/java/org/apache/airavata/cloud/intf/impl/OpenstackIntfImpl.java @@ -308,10 +308,10 @@ public class OpenstackIntfImpl implements CloudInterface { } if(publicNetId != null) { router = os.networking().router().create(Builders.router() - .name(routerName) - .adminStateUp(true) - .externalGateway(publicNetId) - .build()); + .name(routerName) + .adminStateUp(true) + .externalGateway(publicNetId) + .build()); logger.info("Created a new router " + router + " for external gateway : [" + externalGatewayName + "]"); } else { logger.error("Failed to create router because external gateway [ " + externalGatewayName + "] is not found!"); @@ -335,15 +335,15 @@ public class OpenstackIntfImpl implements CloudInterface { networkId = network.getId(); } } - + if(networkId != null) { subnet = os.networking().subnet().create(Builders.subnet() - .enableDHCP(true) - .name(subnetName) - .networkId(networkId) - .ipVersion(IPVersionType.valueOf(ipVersion)) - .cidr(subnetCIDR) - .build()); + .enableDHCP(true) + .name(subnetName) + .networkId(networkId) + .ipVersion(IPVersionType.valueOf(ipVersion)) + .cidr(subnetCIDR) + .build()); logger.info("Created a subnet : " + subnetName + " for network [ " + networkName + "]"); } else { logger.error("Failed to create subnet because network [ " + networkName + "] is not found!"); @@ -367,18 +367,18 @@ public class OpenstackIntfImpl implements CloudInterface { subnetId = subnet.getId(); } } - + // get routerid from name for(Router router : os.networking().router().list()) { if(router.getName().equals(routerName)) { routerId = router.getId(); } } - + if(routerId != null && subnetId != null) { // attach external interface to gateway iface = os.networking().router() - .attachInterface(routerId, AttachInterfaceType.SUBNET, subnetId); + .attachInterface(routerId, AttachInterfaceType.SUBNET, subnetId); logger.info("Attached external interface to router : " + iface); } else { logger.error("Either router or network is not found. Kindly re-check and try again."); @@ -434,7 +434,7 @@ public class OpenstackIntfImpl implements CloudInterface { // TODO: Check with the team on how to handle exceptions. logger.error("Failed to delete subnet: " + subnetName + ". Exception: " + ex.getMessage(), ex); } - + } @Override @@ -451,7 +451,7 @@ public class OpenstackIntfImpl implements CloudInterface { // TODO: Check with the team on how to handle exceptions. logger.error("Failed to delete router: " + routerName + ". Exception: " + ex.getMessage(), ex); } - + } @Override http://git-wip-us.apache.org/repos/asf/airavata/blob/de05f6b4/modules/cloud/cloud-provisioning/src/main/java/org/apache/airavata/cloud/util/Constants.java ---------------------------------------------------------------------- diff --git a/modules/cloud/cloud-provisioning/src/main/java/org/apache/airavata/cloud/util/Constants.java b/modules/cloud/cloud-provisioning/src/main/java/org/apache/airavata/cloud/util/Constants.java index 24b1729..63bdebc 100644 --- a/modules/cloud/cloud-provisioning/src/main/java/org/apache/airavata/cloud/util/Constants.java +++ b/modules/cloud/cloud-provisioning/src/main/java/org/apache/airavata/cloud/util/Constants.java @@ -29,28 +29,28 @@ public class Constants { /** The Constant OS_AUTH_URL. */ // OpenStack openrc string constants. public static final String OS_AUTH_URL = "OS_AUTH_URL"; - + /** The Constant OS_IDENTITY_API_VERSION. */ public static final String OS_IDENTITY_API_VERSION = "OS_IDENTITY_API_VERSION"; - + /** The Constant OS_USERNAME. */ public static final String OS_USERNAME = "OS_USERNAME"; - + /** The Constant OS_PASSWORD. */ public static final String OS_PASSWORD = "OS_PASSWORD"; - + /** The Constant OS_USER_DOMAIN_NAME. */ public static final String OS_USER_DOMAIN_NAME = "OS_USER_DOMAIN_NAME"; - + /** The Constant OS_PROJECT_DOMAIN_NAME. */ public static final String OS_PROJECT_DOMAIN_NAME = "OS_PROJECT_DOMAIN_NAME"; - + /** The Constant OS_FLOATING_IP_POOL. */ public static final String OS_FLOATING_IP_POOL = "OS_FLOATING_IP_POOL"; - + /** The Constant OS_NETWORK_NAME. */ public static final String OS_NETWORK_NAME = "OS_NETWORK_NAME"; - + /** The Constant OS_IP_VERSION_DEFAULT. */ public static final Integer OS_IP_VERSION_DEFAULT = 4; } http://git-wip-us.apache.org/repos/asf/airavata/blob/de05f6b4/modules/cloud/cloud-provisioning/src/main/resources/jetstream_openrc.properties ---------------------------------------------------------------------- diff --git a/modules/cloud/cloud-provisioning/src/main/resources/jetstream_openrc.properties b/modules/cloud/cloud-provisioning/src/main/resources/jetstream_openrc.properties index a2c0414..2147350 100644 --- a/modules/cloud/cloud-provisioning/src/main/resources/jetstream_openrc.properties +++ b/modules/cloud/cloud-provisioning/src/main/resources/jetstream_openrc.properties @@ -24,10 +24,10 @@ OS_USER_DOMAIN_NAME=tacc OS_PROJECT_NAME=scigap OS_TENANT_NAME=scigap OS_USERNAME=scigap -OS_PASSWORD=xxxxxxxxxxx +OS_PASSWORD=xxxxxxxx OS_AUTH_URL=https://jblb.jetstream-cloud.org:35357/v3 OS_IDENTITY_API_VERSION=3 # Network Properties OS_FLOATING_IP_POOL=public -OS_NETWORK_NAME=airavata \ No newline at end of file +OS_NETWORK_NAME=airavata http://git-wip-us.apache.org/repos/asf/airavata/blob/de05f6b4/modules/cloud/cloud-provisioning/src/test/java/org/apache/airavata/cloud/test/CloudIntfTest.java ---------------------------------------------------------------------- diff --git a/modules/cloud/cloud-provisioning/src/test/java/org/apache/airavata/cloud/test/CloudIntfTest.java b/modules/cloud/cloud-provisioning/src/test/java/org/apache/airavata/cloud/test/CloudIntfTest.java index a77725b..8d0a60b 100644 --- a/modules/cloud/cloud-provisioning/src/test/java/org/apache/airavata/cloud/test/CloudIntfTest.java +++ b/modules/cloud/cloud-provisioning/src/test/java/org/apache/airavata/cloud/test/CloudIntfTest.java @@ -133,7 +133,7 @@ public class CloudIntfTest { fail(); } } - + /** * Jetstream create delete network test. */ @@ -141,18 +141,18 @@ public class CloudIntfTest { public void jetstreamCreateDeleteNetworkTest() { try { CloudInterface cloudIntf = new OpenstackIntfImpl("jetstream_openrc.properties"); - + /* fetch sample data from properties file */ String networkName = properties.getProperty("jetstream_network_name"); String subnetCIDR = properties.getProperty("jetstream_subnet_cidr"); Integer ipVersion = Integer.valueOf(properties.getProperty("jetstream_ip_version", - Constants.OS_IP_VERSION_DEFAULT.toString())); + Constants.OS_IP_VERSION_DEFAULT.toString())); String externalGateway = properties.getProperty("jetstream_public_network_name"); - + /* build router and subnet names */ String subnetName = "subnet-" + networkName; String routerName = "router-" + networkName; - + /* create network */ logger.info("Creating network with name = " + networkName); Network network = (Network) cloudIntf.createNetwork(networkName); @@ -165,29 +165,29 @@ public class CloudIntfTest { && subnet.getName().equals(subnetName) && subnet.getCidr().equals(subnetCIDR) && subnet.getIpVersion().getVersion() == ipVersion.intValue()); - + /* create router for external gateway */ logger.info("Creating router with name = " + routerName + ", and external gateway = " + externalGateway); Router router = (Router) cloudIntf.createRouter(routerName, externalGateway); assertTrue(router != null && router.getName().equals(routerName)); - + /* create router-subnet interface */ logger.info("Creating interface between router = " + routerName + ", and subnet = " + subnetName); RouterInterface iface = (RouterInterface) cloudIntf.createRouterSubnetInterface(routerName, subnetName); assertTrue(iface != null && iface.getSubnetId().equals(subnet.getId())); - + /* delete router-subnet interface */ logger.info("Deleting interface between router = " + routerName + ", and subnet = " + subnetName); cloudIntf.deleteRouterSubnetInterface(routerName, subnetName); - + /* delete router for external gateway */ logger.info("Creating router with name = " + routerName); cloudIntf.deleteRouter(routerName); - + /* delete subnet for network */ logger.info("Creating subnet with name = " + subnetName); cloudIntf.deleteSubnet(subnetName); - + /* delete network */ logger.info("Deleting network with name = " + networkName); cloudIntf.deleteNetwork(networkName); @@ -195,6 +195,6 @@ public class CloudIntfTest { ex.printStackTrace(); fail(); } - + } } http://git-wip-us.apache.org/repos/asf/airavata/blob/de05f6b4/modules/cloud/cloud-provisioning/src/test/resources/test_data.properties ---------------------------------------------------------------------- diff --git a/modules/cloud/cloud-provisioning/src/test/resources/test_data.properties b/modules/cloud/cloud-provisioning/src/test/resources/test_data.properties index 5be93b1..b5ded31 100644 --- a/modules/cloud/cloud-provisioning/src/test/resources/test_data.properties +++ b/modules/cloud/cloud-provisioning/src/test/resources/test_data.properties @@ -29,4 +29,4 @@ jetstream_flavorId=3 jetstream_network_name=test-network jetstream_public_network_name=public jetstream_subnet_cidr=192.168.7.0/24 -jetstream_ip_version=4 \ No newline at end of file +jetstream_ip_version=4
