You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jclouds.apache.org by inbar stolberg <no...@github.com> on 2013/10/14 10:26:21 UTC

[jclouds] openstack CreateServerOptions added availability zone option (#180)

create server options for Openstack, added the option to select availability zone
You can merge this Pull Request by running:

  git pull https://github.com/inbarsto/jclouds-1 createServerByZone

Or you can view, comment on it, or merge it online at:

  https://github.com/jclouds/jclouds/pull/180

-- Commit Summary --

  * openstack CreateServerOptions added availability zone option

-- File Changes --

    M apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/options/CreateServerOptions.java (122)
    A apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/CreateServerApiLiveTest.java (92)

-- Patch Links --

https://github.com/jclouds/jclouds/pull/180.patch
https://github.com/jclouds/jclouds/pull/180.diff

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by inbar stolberg <no...@github.com>.
you now have only one squashed commit on the remote branch...

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180#issuecomment-26417018

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by inbar stolberg <no...@github.com>.
> @@ -150,6 +148,8 @@ protected ToStringHelper string() {
>        toString.add("userData", userData == null ? null : new String(userData));
>        if (!networks.isEmpty())
>           toString.add("networks", networks);
> +      if (availabilityZone != null)
> +         toString.add("availability_zone", availabilityZone);

fixed

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180/files#r6992926

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-java-7-pull-requests #795](https://jclouds.ci.cloudbees.com/job/jclouds-java-7-pull-requests/795/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180#issuecomment-26481907

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-pull-requests #325](https://jclouds.ci.cloudbees.com/job/jclouds-pull-requests/325/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180#issuecomment-26413389

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by Andrew Phillips <no...@github.com>.
> can you take them from there, i am having problems reverting the remote branch to its original state...

OK, I'll try and take the diff from there later today (but of a rush here right now). Thanks!

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180#issuecomment-26417013

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by inbar stolberg <no...@github.com>.
Sorry :-) over excited. First contribution and all.. :-)

Sent from my Android




-----Original Message-----
From: Andrew Phillips [notifications@github.com]
Received: Friday, 18 Oct 2013, 15:28
To: jclouds/jclouds [jclouds@noreply.github.com]
CC: STOLBERG, Inbar (Inbar) [inbar.stolberg@alcatel-lucent.com]
Subject: Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)


good to go :)

Thanks for confirming, @inbarsto<https://github.com/inbarsto>. I was actually checking with @everett-toews<https://github.com/everett-toews>, since he was the one that added the last set of "things left to do" ;-)

—
Reply to this email directly or view it on GitHub<https://github.com/jclouds/jclouds/pull/180#issuecomment-26591680>.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180#issuecomment-26600922

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by inbar stolberg <no...@github.com>.
added a jira ticket please let me know if i need to change add anything since this is my first jira ticket.
also i noticed i cant assign my self to the task, any idea why?

https://issues.apache.org/jira/browse/JCLOUDS-349

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180#issuecomment-26395189

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by Andrew Phillips <no...@github.com>.
> +      options = options.availabilityZone(availabilityZoneId);
> +      ServerCreated server = serverApi.create(hostName, imageIdForZone(regionId), flavorRefForZone(regionId), options);
> +      if (shouldWork) {
> +         blockUntilServerInState(server.getId(), serverApi, Server.Status.ACTIVE);
> +      } else {
> +         blockUntilServerInState(server.getId(), serverApi, Server.Status.ERROR);
> +      }
> +
> +      return serverApi.get(server.getId());
> +   }
> +
> +   @Test
> +   public void testCreateInAvailabilityZone() {
> +
> +      String server_id1 = null;
> +      String server_id2 = null;

Use Java variable naming, e.g. "serverId1"?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180/files#r6972789

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by Andrew Phillips <no...@github.com>.
> @@ -150,6 +148,8 @@ protected ToStringHelper string() {
>        toString.add("userData", userData == null ? null : new String(userData));
>        if (!networks.isEmpty())
>           toString.add("networks", networks);
> +      if (availabilityZone != null)
> +         toString.add("availability_zone", availabilityZone);

Any reason why the logic here is different than for `userData` just above?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180/files#r6972631

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by inbar stolberg <no...@github.com>.
> +
> +import static org.testng.Assert.assertEquals;
> +
> +@Test(groups = "live", testName = "CreateServerApiLiveTest", singleThreaded = true)
> +public class CreateServerApiLiveTest extends BaseNovaApiLiveTest {
> +   private ServerApi serverApi;
> +   private String zone;
> +
> +   @BeforeGroups(groups = {"integration", "live"})
> +   public void setupContext() {
> +      super.setup();
> +      zone = Iterables.getLast(api.getConfiguredZones(), "nova");
> +      serverApi = api.getServerApiForZone(zone);
> +   }
> +
> +   private Server createServer(String regionId, String availabilityZoneId, boolean shouldWork) {

fixed

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180/files#r6992950

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by BuildHive <no...@github.com>.
[jclouds » jclouds #531](https://buildhive.cloudbees.com/job/jclouds/job/jclouds/531/) UNSTABLE
Looks like there's a problem with this pull request
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180#issuecomment-26418163

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by Everett Toews <no...@github.com>.
I ran the live test successfully. Just a few things left to do.

- [ ] Move live tests to ServerApiLiveTest
- [ ] Add an expect test to org.jclouds.openstack.nova.v2_0.features.ServerApiExpectTest
- [ ] Squash down the new commits

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180#issuecomment-26452563

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-java-7-pull-requests #764](https://jclouds.ci.cloudbees.com/job/jclouds-java-7-pull-requests/764/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180#issuecomment-26243061

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by inbar stolberg <no...@github.com>.
i am having problem with the squash basically all the changes for master are in the commit  	JCLOUDS-349 … 	64e8308

can you take them from there, i am having problems reverting the remote branch to its original state...

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180#issuecomment-26415690

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by BuildHive <no...@github.com>.
[jclouds » jclouds #534](https://buildhive.cloudbees.com/job/jclouds/job/jclouds/534/) SUCCESS
This pull request looks good
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180#issuecomment-26481726

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by Andrew Phillips <no...@github.com>.
> good to go :)

Thanks for confirming, @inbarsto. I was actually checking with @everett-toews, since he was the one that added the last set of "things left to do" ;-)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180#issuecomment-26591680

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-java-7-pull-requests #788](https://jclouds.ci.cloudbees.com/job/jclouds-java-7-pull-requests/788/) FAILURE
Looks like there's a problem with this pull request

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180#issuecomment-26417037

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by inbar stolberg <no...@github.com>.
Yes

Sent from my Android




-----Original Message-----
From: Andrew Phillips [notifications@github.com]
Received: Friday, 18 Oct 2013, 2:48
To: jclouds/jclouds [jclouds@noreply.github.com]
CC: STOLBERG, Inbar (Inbar) [inbar.stolberg@alcatel-lucent.com]
Subject: Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)


@everett-toews<https://github.com/everett-toews> This good to go for you?

—
Reply to this email directly or view it on GitHub<https://github.com/jclouds/jclouds/pull/180#issuecomment-26562567>.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180#issuecomment-26571310

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by Andrew Phillips <no...@github.com>.
> @@ -121,9 +119,9 @@ public boolean equals(Object object) {
>        if (object instanceof CreateServerOptions) {
>           final CreateServerOptions other = CreateServerOptions.class.cast(object);
>           return equal(keyName, other.keyName) && equal(securityGroupNames, other.securityGroupNames)
> -                  && equal(metadata, other.metadata) && equal(personality, other.personality)
> -                  && equal(adminPass, other.adminPass) && equal(diskConfig, other.diskConfig)
> -                  && equal(adminPass, other.adminPass) && equal(networks, other.networks);
> +               && equal(metadata, other.metadata) && equal(personality, other.personality)
> +               && equal(adminPass, other.adminPass) && equal(diskConfig, other.diskConfig)
> +               && equal(adminPass, other.adminPass) && equal(networks, other.networks) && equal(availabilityZone, other.availabilityZone);

[minor] Move the last `equal` to a new line?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180/files#r6972605

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by inbar stolberg <no...@github.com>.
> @@ -354,12 +367,12 @@ public CreateServerOptions securityGroupNames(Iterable<String> securityGroupName
>     }
>  
>     /**
> -    * When you create a server from an image with the diskConfig value set to 
> -    * {@link Server#DISK_CONFIG_AUTO}, the server is built with a single partition that is expanded to 
> -    * the disk size of the flavor selected. When you set the diskConfig attribute to 
> -    * {@link Server#DISK_CONFIG_MANUAL}, the server is built by using the partition scheme and file 
> +    * When you create a server from an image with the diskConfig value set to
> +    * {@link Server#DISK_CONFIG_AUTO}, the server is built with a single partition that is expanded to
> +    * the disk size of the flavor selected. When you set the diskConfig attribute to
> +    * {@link Server#DISK_CONFIG_MANUAL}, the server is built by using the partition scheme and file

yes

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180/files#r6992934

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-java-7-pull-requests #792](https://jclouds.ci.cloudbees.com/job/jclouds-java-7-pull-requests/792/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180#issuecomment-26424931

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by BuildHive <no...@github.com>.
[jclouds » jclouds #519](https://buildhive.cloudbees.com/job/jclouds/job/jclouds/519/) SUCCESS
This pull request looks good
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180#issuecomment-26314890

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by Andrew Phillips <no...@github.com>.
Thanks for the fixes, @inbarsto! Almost there, I think ;-)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180#issuecomment-26402535

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-java-7-pull-requests #780](https://jclouds.ci.cloudbees.com/job/jclouds-java-7-pull-requests/780/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180#issuecomment-26404832

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-pull-requests #322](https://jclouds.ci.cloudbees.com/job/jclouds-pull-requests/322/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180#issuecomment-26410908

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by inbar stolberg <no...@github.com>.
> +import org.jclouds.rest.binders.BindToJsonPayload;
> +
> +import javax.inject.Inject;
> +import javax.inject.Named;
> +import java.util.List;
> +import java.util.Map;
> +import java.util.Map.Entry;
> +import java.util.Set;
> +
> +import static com.google.common.base.Objects.equal;
> +import static com.google.common.base.Objects.toStringHelper;
> +import static com.google.common.base.Preconditions.checkArgument;
> +import static com.google.common.base.Preconditions.checkNotNull;
> +import static com.google.common.base.Preconditions.checkState;
> +import static com.google.common.base.Strings.emptyToNull;
> +import static com.google.common.io.BaseEncoding.base64;

sorry 

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180/files#r6992825

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by Andrew Phillips <no...@github.com>.
Let me close-n-reopen to trigger the CI builds again...thanks, @inbarsto!

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180#issuecomment-26423144

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-pull-requests #329](https://jclouds.ci.cloudbees.com/job/jclouds-pull-requests/329/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180#issuecomment-26424921

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by Andrew Phillips <no...@github.com>.
> @@ -354,12 +367,12 @@ public CreateServerOptions securityGroupNames(Iterable<String> securityGroupName
>     }
>  
>     /**
> -    * When you create a server from an image with the diskConfig value set to 
> -    * {@link Server#DISK_CONFIG_AUTO}, the server is built with a single partition that is expanded to 
> -    * the disk size of the flavor selected. When you set the diskConfig attribute to 
> -    * {@link Server#DISK_CONFIG_MANUAL}, the server is built by using the partition scheme and file 
> +    * When you create a server from an image with the diskConfig value set to
> +    * {@link Server#DISK_CONFIG_AUTO}, the server is built with a single partition that is expanded to
> +    * the disk size of the flavor selected. When you set the diskConfig attribute to
> +    * {@link Server#DISK_CONFIG_MANUAL}, the server is built by using the partition scheme and file

In that case, can we remove it from the PR? Not a big deal, so no need to worry about this if it's difficult.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180/files#r6995523

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by Everett Toews <no...@github.com>.
> + * @author Inbar Stolberg
> + */
> +
> +import com.google.common.base.Optional;
> +import com.google.common.collect.Iterables;
> +import org.jclouds.openstack.nova.v2_0.domain.Server;
> +import org.jclouds.openstack.nova.v2_0.domain.ServerCreated;
> +import org.jclouds.openstack.nova.v2_0.features.ServerApi;
> +import org.jclouds.openstack.nova.v2_0.internal.BaseNovaApiLiveTest;
> +import org.jclouds.openstack.nova.v2_0.options.CreateServerOptions;
> +import org.testng.annotations.BeforeGroups;
> +import org.testng.annotations.Test;
> +
> +import static org.testng.Assert.assertEquals;
> +
> +@Test(groups = "live", testName = "CreateServerApiLiveTest", singleThreaded = true)

These tests should be in ServerApiLiveTest

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180/files#r7013928

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by Andrew Phillips <no...@github.com>.
> @@ -150,6 +149,7 @@ protected ToStringHelper string() {
>        toString.add("userData", userData == null ? null : new String(userData));
>        if (!networks.isEmpty())
>           toString.add("networks", networks);
> +      toString.add("availavility_zone", availabilityZone == null ? null : availabilityZone);

Typo? "availavility_zone"

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180/files#r6995500

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-pull-requests #326](https://jclouds.ci.cloudbees.com/job/jclouds-pull-requests/326/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180#issuecomment-26418650

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by Andrew Phillips <no...@github.com>.
Some minor spurious changes still here but that shouldn't stop this PR, in my opinion. +1 - looks good to me. 

@inbarsto: could you create a JIRA issue and squash-n-rebase your commits, mentioning the issue number in the new commit message? Thanks!

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180#issuecomment-26408997

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-pull-requests #318](https://jclouds.ci.cloudbees.com/job/jclouds-pull-requests/318/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180#issuecomment-26404831

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by Andrew Phillips <no...@github.com>.
> +import org.jclouds.rest.binders.BindToJsonPayload;
> +
> +import javax.inject.Inject;
> +import javax.inject.Named;
> +import java.util.List;
> +import java.util.Map;
> +import java.util.Map.Entry;
> +import java.util.Set;
> +
> +import static com.google.common.base.Objects.equal;
> +import static com.google.common.base.Objects.toStringHelper;
> +import static com.google.common.base.Preconditions.checkArgument;
> +import static com.google.common.base.Preconditions.checkNotNull;
> +import static com.google.common.base.Preconditions.checkState;
> +import static com.google.common.base.Strings.emptyToNull;
> +import static com.google.common.io.BaseEncoding.base64;

> sorry

No problem! Just a comment for future reviews ;-)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180/files#r6995496

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by Everett Toews <no...@github.com>.
I love the enthusiasm! Nice work @inbarsto 

+1

Merged!

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180#issuecomment-26601802

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by Andrew Phillips <no...@github.com>.
> @@ -354,12 +367,12 @@ public CreateServerOptions securityGroupNames(Iterable<String> securityGroupName
>     }
>  
>     /**
> -    * When you create a server from an image with the diskConfig value set to 
> -    * {@link Server#DISK_CONFIG_AUTO}, the server is built with a single partition that is expanded to 
> -    * the disk size of the flavor selected. When you set the diskConfig attribute to 
> -    * {@link Server#DISK_CONFIG_MANUAL}, the server is built by using the partition scheme and file 
> +    * When you create a server from an image with the diskConfig value set to
> +    * {@link Server#DISK_CONFIG_AUTO}, the server is built with a single partition that is expanded to
> +    * the disk size of the flavor selected. When you set the diskConfig attribute to
> +    * {@link Server#DISK_CONFIG_MANUAL}, the server is built by using the partition scheme and file

Spurious change?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180/files#r6972713

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by inbar stolberg <no...@github.com>.
https://issues.apache.org/jira/browse/JCLOUDS-349

;)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180#issuecomment-26409456

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by Andrew Phillips <no...@github.com>.
Thanks for the PR, @inbarsto. In general: could you keep the formatting and other "misc" changes that are not related to this functionality to a separate PR? That makes it easy to concentrate on _new_ stuff during the review, and we are also not mixing cleanup with new functionality in one PR.

Also: could you add a JIRA issue for the new functionality, and rename the commit to reference it? Thanks!

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180#issuecomment-26340636

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-pull-requests #316](https://jclouds.ci.cloudbees.com/job/jclouds-pull-requests/316/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180#issuecomment-26397196

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by Andrew Phillips <no...@github.com>.
> @@ -162,6 +162,8 @@ public String toString() {
>        final String name;
>        final String imageRef;
>        final String flavorRef;
> +      @Named("availability_zone")

What does the `@Named` do here?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180/files#r6972651

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by inbar stolberg <no...@github.com>.
> @@ -121,9 +119,9 @@ public boolean equals(Object object) {
>        if (object instanceof CreateServerOptions) {
>           final CreateServerOptions other = CreateServerOptions.class.cast(object);
>           return equal(keyName, other.keyName) && equal(securityGroupNames, other.securityGroupNames)
> -                  && equal(metadata, other.metadata) && equal(personality, other.personality)
> -                  && equal(adminPass, other.adminPass) && equal(diskConfig, other.diskConfig)
> -                  && equal(adminPass, other.adminPass) && equal(networks, other.networks);
> +               && equal(metadata, other.metadata) && equal(personality, other.personality)
> +               && equal(adminPass, other.adminPass) && equal(diskConfig, other.diskConfig)
> +               && equal(adminPass, other.adminPass) && equal(networks, other.networks) && equal(availabilityZone, other.availabilityZone);

fixed

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180/files#r6992824

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by Andrew Phillips <no...@github.com>.
> +   private Server createServer(String regionId, String availabilityZoneId, boolean shouldWork) {
> +      ServerApi serverApi = api.getServerApiForZone(regionId);
> +      CreateServerOptions options = new CreateServerOptions();
> +      options = options.availabilityZone(availabilityZoneId);
> +      ServerCreated server = serverApi.create(hostName, imageIdForZone(regionId), flavorRefForZone(regionId), options);
> +      if (shouldWork) {
> +         blockUntilServerInState(server.getId(), serverApi, Server.Status.ACTIVE);
> +      } else {
> +         blockUntilServerInState(server.getId(), serverApi, Server.Status.ERROR);
> +      }
> +
> +      return serverApi.get(server.getId());
> +   }
> +
> +   @Test
> +   public void testCreateInAvailabilityZone() {

Can we split this into two tests - one that should succeed and one that should fail? If this one fails, we now don't know what the problem is.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180/files#r6972821

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by inbar stolberg <no...@github.com>.
> +      options = options.availabilityZone(availabilityZoneId);
> +      ServerCreated server = serverApi.create(hostName, imageIdForZone(regionId), flavorRefForZone(regionId), options);
> +      if (shouldWork) {
> +         blockUntilServerInState(server.getId(), serverApi, Server.Status.ACTIVE);
> +      } else {
> +         blockUntilServerInState(server.getId(), serverApi, Server.Status.ERROR);
> +      }
> +
> +      return serverApi.get(server.getId());
> +   }
> +
> +   @Test
> +   public void testCreateInAvailabilityZone() {
> +
> +      String server_id1 = null;
> +      String server_id2 = null;

fixed

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180/files#r6992951

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-java-7-pull-requests #794](https://jclouds.ci.cloudbees.com/job/jclouds-java-7-pull-requests/794/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180#issuecomment-26480987

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-java-7-pull-requests #778](https://jclouds.ci.cloudbees.com/job/jclouds-java-7-pull-requests/778/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180#issuecomment-26397228

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by inbar stolberg <no...@github.com>.
Thank you very very much for your patience and help.

Regards inbar

Sent from my Android




-----Original Message-----
From: Everett Toews [notifications@github.com]
Received: Friday, 18 Oct 2013, 17:51
To: jclouds/jclouds [jclouds@noreply.github.com]
CC: STOLBERG, Inbar (Inbar) [inbar.stolberg@alcatel-lucent.com]
Subject: Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)


I love the enthusiasm! Nice work @inbarsto<https://github.com/inbarsto>

+1

Merged!

—
Reply to this email directly or view it on GitHub<https://github.com/jclouds/jclouds/pull/180#issuecomment-26601802>.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180#issuecomment-26606792

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by Andrew Phillips <no...@github.com>.
@everett-toews This good to go for you?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180#issuecomment-26562567

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-pull-requests #332](https://jclouds.ci.cloudbees.com/job/jclouds-pull-requests/332/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180#issuecomment-26481980

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-java-7-pull-requests #787](https://jclouds.ci.cloudbees.com/job/jclouds-java-7-pull-requests/787/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180#issuecomment-26413422

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-pull-requests #310](https://jclouds.ci.cloudbees.com/job/jclouds-pull-requests/310/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180#issuecomment-26311756

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-java-7-pull-requests #784](https://jclouds.ci.cloudbees.com/job/jclouds-java-7-pull-requests/784/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180#issuecomment-26411115

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-java-7-pull-requests #772](https://jclouds.ci.cloudbees.com/job/jclouds-java-7-pull-requests/772/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180#issuecomment-26311762

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by BuildHive <no...@github.com>.
[jclouds » jclouds #527](https://buildhive.cloudbees.com/job/jclouds/job/jclouds/527/) SUCCESS
This pull request looks good
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180#issuecomment-26407219

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by inbar stolberg <no...@github.com>.
> +   private Server createServer(String regionId, String availabilityZoneId, boolean shouldWork) {
> +      ServerApi serverApi = api.getServerApiForZone(regionId);
> +      CreateServerOptions options = new CreateServerOptions();
> +      options = options.availabilityZone(availabilityZoneId);
> +      ServerCreated server = serverApi.create(hostName, imageIdForZone(regionId), flavorRefForZone(regionId), options);
> +      if (shouldWork) {
> +         blockUntilServerInState(server.getId(), serverApi, Server.Status.ACTIVE);
> +      } else {
> +         blockUntilServerInState(server.getId(), serverApi, Server.Status.ERROR);
> +      }
> +
> +      return serverApi.get(server.getId());
> +   }
> +
> +   @Test
> +   public void testCreateInAvailabilityZone() {

fixed

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180/files#r6992999

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by Andrew Phillips <no...@github.com>.
> +
> +import static org.testng.Assert.assertEquals;
> +
> +@Test(groups = "live", testName = "CreateServerApiLiveTest", singleThreaded = true)
> +public class CreateServerApiLiveTest extends BaseNovaApiLiveTest {
> +   private ServerApi serverApi;
> +   private String zone;
> +
> +   @BeforeGroups(groups = {"integration", "live"})
> +   public void setupContext() {
> +      super.setup();
> +      zone = Iterables.getLast(api.getConfiguredZones(), "nova");
> +      serverApi = api.getServerApiForZone(zone);
> +   }
> +
> +   private Server createServer(String regionId, String availabilityZoneId, boolean shouldWork) {

Replace the "magic boolean" with an `expectedState` parameter? I think that would make the test easier to read... 

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180/files#r6972772

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by Andrew Phillips <no...@github.com>.
Closed #180.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by Andrew Phillips <no...@github.com>.
Thanks! But we now have 6 commits where we really want only **1** :-( Could you have a look at [squashing them](http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html)?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180#issuecomment-26411673

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-pull-requests #302](https://jclouds.ci.cloudbees.com/job/jclouds-pull-requests/302/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180#issuecomment-26242997

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by Andrew Phillips <no...@github.com>.
> +import org.jclouds.rest.binders.BindToJsonPayload;
> +
> +import javax.inject.Inject;
> +import javax.inject.Named;
> +import java.util.List;
> +import java.util.Map;
> +import java.util.Map.Entry;
> +import java.util.Set;
> +
> +import static com.google.common.base.Objects.equal;
> +import static com.google.common.base.Objects.toStringHelper;
> +import static com.google.common.base.Preconditions.checkArgument;
> +import static com.google.common.base.Preconditions.checkNotNull;
> +import static com.google.common.base.Preconditions.checkState;
> +import static com.google.common.base.Strings.emptyToNull;
> +import static com.google.common.io.BaseEncoding.base64;

Please do not re-order imports - keep the original order so that it is easier to track the actual changes.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180/files#r6972597

Re: [jclouds] openstack CreateServerOptions added availability zone option (#180)

Posted by Everett Toews <no...@github.com>.
@inbarsto Go ahead and close the JIRA issue too.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/180#issuecomment-26601866