Skip to content
Permalink
Browse files
Corrected CentOS and some spelling and formatting errors.
  • Loading branch information
Everett Toews committed Oct 24, 2013
1 parent 3b32782 commit 0d9920567ef5362d28c591a1dc8300850a9d6c7a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
@@ -119,13 +119,13 @@ public CreateVolumeAndAttach(String username, String apiKey) {
}

private NodeMetadata createServer() throws RunNodesException, TimeoutException {
System.out.format("Create Server%n");

Template template = computeService.templateBuilder()
.locationId(ZONE)
.osDescriptionMatches(".*CentOS 6.2.*")
.osDescriptionMatches(".*CentOS 6.4.*")
.minRam(512).build();

System.out.format("Create Server%n");

Set<? extends NodeMetadata> nodes = computeService.createNodesInGroup(NAME, 1, template);
NodeMetadata nodeMetadata = nodes.iterator().next();
String publicAddress = nodeMetadata.getPublicAddresses().iterator().next();
@@ -96,7 +96,7 @@ public CloudServersPublish(List<String> args) {

Iterable<Module> modules = ImmutableSet.<Module> of(new SshjSshClientModule());

// These properties control how often jclouds polls for a status udpate
// These properties control how often jclouds polls for a status update
Properties overrides = new Properties();
overrides.setProperty(POLL_INITIAL_PERIOD, POLL_PERIOD_TWENTY_SECONDS);
overrides.setProperty(POLL_MAX_PERIOD, POLL_PERIOD_TWENTY_SECONDS);
@@ -110,21 +110,21 @@ public CloudServersPublish(List<String> args) {
}

private Set<? extends NodeMetadata> createServer() throws RunNodesException, TimeoutException {
System.out.format("Create Server%n");

Template template = computeService.templateBuilder()
.locationId(ZONE)
.osDescriptionMatches(".*CentOS 6.2.*")
.osDescriptionMatches(".*CentOS 6.4.*")
.minRam(512)
.build();

System.out.format("Create Server");

// This method will continue to poll for the server status and won't return until this server is ACTIVE
// If you want to know what's happening during the polling, enable logging.
// See /jclouds-example/rackspace/src/main/java/org/jclouds/examples/rackspace/Logging.java
Set<? extends NodeMetadata> nodes = computeService.createNodesInGroup(NAME, numServers, template);

for (NodeMetadata nodeMetadata: nodes) {
System.out.format(" ", nodeMetadata);
System.out.format(" %s%n", nodeMetadata);
}

return nodes;
@@ -135,7 +135,7 @@ private void configureAndStartWebserver(Set<? extends NodeMetadata> nodes) throw
String publicAddress = nodeMetadata.getPublicAddresses().iterator().next();
String privateAddress = nodeMetadata.getPrivateAddresses().iterator().next();

System.out.format("Configure And Start Webserver%n");
System.out.format(" Configure And Start Webserver%n");

awaitSsh(publicAddress);

@@ -155,9 +155,9 @@ private void configureAndStartWebserver(Set<? extends NodeMetadata> nodes) throw

computeService.runScriptOnNode(nodeMetadata.getId(), script, options);

System.out.format(" Login: ssh %s@%s%n", nodeMetadata.getCredentials().getUser(), publicAddress);
System.out.format(" Password: %s%n", nodeMetadata.getCredentials().getPassword());
System.out.format(" Go to http://%s%n", publicAddress);
System.out.format(" Login: ssh %s@%s%n", nodeMetadata.getCredentials().getUser(), publicAddress);
System.out.format(" Password: %s%n", nodeMetadata.getCredentials().getPassword());
System.out.format(" Go to http://%s%n", publicAddress);
}
}

@@ -68,7 +68,7 @@ public static void main(String[] args) throws IOException {
}

public CreateServer(String username, String apiKey) {
// These properties control how often jclouds polls for a status udpate
// These properties control how often jclouds polls for a status update
Properties overrides = new Properties();
overrides.setProperty(POLL_INITIAL_PERIOD, POLL_PERIOD_TWENTY_SECONDS);
overrides.setProperty(POLL_MAX_PERIOD, POLL_PERIOD_TWENTY_SECONDS);
@@ -93,14 +93,14 @@ public CreateServer(String username, String apiKey) {
* .build();
*/
private void createServer() throws RunNodesException, TimeoutException {
System.out.format("Create Server%n");

Template template = computeService.templateBuilder()
.locationId(getLocationId())
.fromHardware(getHardware())
.fromImage(getImage())
.build();

System.out.format("Create Server%n");

// This method will continue to poll for the server status and won't return until this server is ACTIVE
// If you want to know what's happening during the polling, enable logging. See
// /jclouds-example/rackspace/src/main/java/org/jclouds/examples/rackspace/Logging.java
@@ -120,12 +120,12 @@ private void createServer() throws RunNodesException, TimeoutException {
* @return The first available Location
*/
private String getLocationId() {
System.out.format("Locations%n");
System.out.format(" Locations%n");

Set<? extends Location> locations = computeService.listAssignableLocations();

for (Location location: locations) {
System.out.format(" %s%n", location);
System.out.format(" %s%n", location);
}

return locations.iterator().next().getId();
@@ -137,13 +137,13 @@ private String getLocationId() {
* @return The Hardware with 512 MB of RAM
*/
private Hardware getHardware() {
System.out.format("Hardware Profiles (Flavors)%n");
System.out.format(" Hardware Profiles (Flavors)%n");

Set<? extends Hardware> profiles = computeService.listHardwareProfiles();
Hardware result = null;

for (Hardware profile: profiles) {
System.out.format(" %s%n", profile);
System.out.format(" %s%n", profile);
if (profile.getRam() == 512) {
result = profile;
}
@@ -163,13 +163,13 @@ private Hardware getHardware() {
* @return An Ubuntu 12.04 Image
*/
private Image getImage() {
System.out.format("Images%n");
System.out.format(" Images%n");

Set<? extends Image> images = computeService.listImages();
Image result = null;

for (Image image: images) {
System.out.format(" %s%n", image);
System.out.format(" %s%n", image);
if (image.getOperatingSystem().getName().equals("Ubuntu 12.04 LTS (Precise Pangolin)")) {
result = image;
}

0 comments on commit 0d99205

Please sign in to comment.