[jira] [Resolved] (JCLOUDS-691) The 404 fallbacks should be removed from PUT and POST operations in the OpenStack APIs

2017-11-25 Thread Reijhanniel Jearl Campos (JIRA)

 [ 
https://issues.apache.org/jira/browse/JCLOUDS-691?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Reijhanniel Jearl Campos resolved JCLOUDS-691.
--
   Resolution: Fixed
Fix Version/s: (was: 2.1.0)
   2.0.0

> The 404 fallbacks should be removed from PUT and POST operations in the 
> OpenStack APIs
> --
>
> Key: JCLOUDS-691
> URL: https://issues.apache.org/jira/browse/JCLOUDS-691
> Project: jclouds
>  Issue Type: Bug
>  Components: jclouds-compute, jclouds-labs-openstack
>Affects Versions: 1.8.0
>Reporter: Ignasi Barrera
>        Assignee: Reijhanniel Jearl Campos
>  Labels: openstack, rackspace, technical_debt
> Fix For: 2.0.0
>
>
> Write operations such as PUT or POST should not use the 404 fallbacks that 
> silently return null instead of propagating an exception. The fallback should 
> be removed so a ResourceNotFoundException is propagated.
> See the discussion here: 
> https://github.com/jclouds/jclouds-labs-openstack/pull/135/files#r16700137



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (JCLOUDS-1100) OpenStack provisioning fails: exception "cidrBlock ::/0 is not a valid CIDR"

2017-11-25 Thread Reijhanniel Jearl Campos (JIRA)

 [ 
https://issues.apache.org/jira/browse/JCLOUDS-1100?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Reijhanniel Jearl Campos updated JCLOUDS-1100:
--
Fix Version/s: 2.0.0

> OpenStack provisioning fails: exception "cidrBlock ::/0 is not a valid CIDR"
> 
>
> Key: JCLOUDS-1100
> URL: https://issues.apache.org/jira/browse/JCLOUDS-1100
> Project: jclouds
>  Issue Type: Bug
>  Components: jclouds-compute
>Affects Versions: 1.9.2
>Reporter: Aled Sage
>Assignee: Zack Shoylev
> Fix For: 2.0.0
>
>
> When provisioning a VM to OpenStack (in IBM's BlueBox), I got the exception 
> below.
> {noformat}
> Failed after 6.11s: Error invoking start at DockerHostImpl{id=uMtN8h3W}: 
> UncheckedExecutionException: java.lang.IllegalArgumentException: cidrBlock 
> ::/0 is not a valid CIDR
> org.apache.brooklyn.core.mgmt.internal.EffectorUtils$EffectorCallPropagatedRuntimeException:
>  Error invoking start at DockerHostImpl{id=uMtN8h3W}: 
> UncheckedExecutionException: java.lang.IllegalArgumentException: cidrBlock 
> ::/0 is not a valid CIDR
>   at 
> org.apache.brooklyn.core.mgmt.internal.EffectorUtils$EffectorCallPropagatedRuntimeException.propagate(EffectorUtils.java:299)
>   at 
> org.apache.brooklyn.core.mgmt.internal.EffectorUtils$EffectorCallPropagatedRuntimeException.access$100(EffectorUtils.java:266)
>   at 
> org.apache.brooklyn.core.mgmt.internal.EffectorUtils.handleEffectorException(EffectorUtils.java:306)
>   at 
> org.apache.brooklyn.core.effector.EffectorTasks$EffectorBodyTaskFactory$2.handleException(EffectorTasks.java:90)
>   at 
> org.apache.brooklyn.util.core.task.DynamicSequentialTask.handleException(DynamicSequentialTask.java:469)
>   at 
> org.apache.brooklyn.util.core.task.DynamicSequentialTask$DstJob.call(DynamicSequentialTask.java:417)
>   at 
> org.apache.brooklyn.util.core.task.BasicExecutionManager$SubmissionCallable.call(BasicExecutionManager.java:518)
>   at java.util.concurrent.FutureTask.run(FutureTask.java:262)
>   at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>   at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>   at java.lang.Thread.run(Thread.java:745)
> Caused by: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: 
> UncheckedExecutionException: java.lang.IllegalArgumentException: cidrBlock 
> ::/0 is not a valid CIDR
>   at 
> org.apache.brooklyn.util.exceptions.Exceptions.propagate(Exceptions.java:128)
>   at 
> org.apache.brooklyn.util.core.task.BasicTask.getUnchecked(BasicTask.java:372)
>   at org.apache.brooklyn.util.core.task.Tasks$2.get(Tasks.java:285)
>   at 
> org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks.preStartAtMachineAsync(MachineLifecycleEffectorTasks.java:412)
>   at 
> org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks.startInLocation(MachineLifecycleEffectorTasks.java:339)
>   at 
> org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks.startInLocations(MachineLifecycleEffectorTasks.java:324)
>   at 
> org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks.start(MachineLifecycleEffectorTasks.java:313)
>   at 
> org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks$StartEffectorBody.call(MachineLifecycleEffectorTasks.java:214)
>   at 
> org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks$StartEffectorBody.call(MachineLifecycleEffectorTasks.java:201)
>   at 
> org.apache.brooklyn.core.effector.EffectorTasks$EffectorBodyTaskFactory$1.call(EffectorTasks.java:82)
>   at 
> org.apache.brooklyn.util.core.task.DynamicSequentialTask$DstJob.call(DynamicSequentialTask.java:359)
>   ... 5 more
> Caused by: java.util.concurrent.ExecutionException: 
> com.google.common.util.concurrent.UncheckedExecutionException: 
> java.lang.IllegalArgumentException: cidrBlock ::/0 is not a valid CIDR
>   at java.util.concurrent.FutureTask.report(FutureTask.java:122)
>   at java.util.concurrent.FutureTask.get(FutureTask.java:188)
>   at 
> com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:63)
>   at org.apache.brooklyn.util.core.task.BasicTask.get(BasicTask.java:361)
>   at 
> org.apache.brooklyn.util.core.task.BasicTask.getUnchecked(BasicTask.java:370)
>   ... 14 more
> Caused by: com.google.co

[jira] [Assigned] (JCLOUDS-1100) OpenStack provisioning fails: exception "cidrBlock ::/0 is not a valid CIDR"

2017-11-25 Thread Reijhanniel Jearl Campos (JIRA)

 [ 
https://issues.apache.org/jira/browse/JCLOUDS-1100?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Reijhanniel Jearl Campos reassigned JCLOUDS-1100:
-

Assignee: Zack Shoylev

> OpenStack provisioning fails: exception "cidrBlock ::/0 is not a valid CIDR"
> 
>
> Key: JCLOUDS-1100
> URL: https://issues.apache.org/jira/browse/JCLOUDS-1100
> Project: jclouds
>  Issue Type: Bug
>  Components: jclouds-compute
>Affects Versions: 1.9.2
>Reporter: Aled Sage
>Assignee: Zack Shoylev
> Fix For: 2.0.0
>
>
> When provisioning a VM to OpenStack (in IBM's BlueBox), I got the exception 
> below.
> {noformat}
> Failed after 6.11s: Error invoking start at DockerHostImpl{id=uMtN8h3W}: 
> UncheckedExecutionException: java.lang.IllegalArgumentException: cidrBlock 
> ::/0 is not a valid CIDR
> org.apache.brooklyn.core.mgmt.internal.EffectorUtils$EffectorCallPropagatedRuntimeException:
>  Error invoking start at DockerHostImpl{id=uMtN8h3W}: 
> UncheckedExecutionException: java.lang.IllegalArgumentException: cidrBlock 
> ::/0 is not a valid CIDR
>   at 
> org.apache.brooklyn.core.mgmt.internal.EffectorUtils$EffectorCallPropagatedRuntimeException.propagate(EffectorUtils.java:299)
>   at 
> org.apache.brooklyn.core.mgmt.internal.EffectorUtils$EffectorCallPropagatedRuntimeException.access$100(EffectorUtils.java:266)
>   at 
> org.apache.brooklyn.core.mgmt.internal.EffectorUtils.handleEffectorException(EffectorUtils.java:306)
>   at 
> org.apache.brooklyn.core.effector.EffectorTasks$EffectorBodyTaskFactory$2.handleException(EffectorTasks.java:90)
>   at 
> org.apache.brooklyn.util.core.task.DynamicSequentialTask.handleException(DynamicSequentialTask.java:469)
>   at 
> org.apache.brooklyn.util.core.task.DynamicSequentialTask$DstJob.call(DynamicSequentialTask.java:417)
>   at 
> org.apache.brooklyn.util.core.task.BasicExecutionManager$SubmissionCallable.call(BasicExecutionManager.java:518)
>   at java.util.concurrent.FutureTask.run(FutureTask.java:262)
>   at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>   at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>   at java.lang.Thread.run(Thread.java:745)
> Caused by: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: 
> UncheckedExecutionException: java.lang.IllegalArgumentException: cidrBlock 
> ::/0 is not a valid CIDR
>   at 
> org.apache.brooklyn.util.exceptions.Exceptions.propagate(Exceptions.java:128)
>   at 
> org.apache.brooklyn.util.core.task.BasicTask.getUnchecked(BasicTask.java:372)
>   at org.apache.brooklyn.util.core.task.Tasks$2.get(Tasks.java:285)
>   at 
> org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks.preStartAtMachineAsync(MachineLifecycleEffectorTasks.java:412)
>   at 
> org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks.startInLocation(MachineLifecycleEffectorTasks.java:339)
>   at 
> org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks.startInLocations(MachineLifecycleEffectorTasks.java:324)
>   at 
> org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks.start(MachineLifecycleEffectorTasks.java:313)
>   at 
> org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks$StartEffectorBody.call(MachineLifecycleEffectorTasks.java:214)
>   at 
> org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks$StartEffectorBody.call(MachineLifecycleEffectorTasks.java:201)
>   at 
> org.apache.brooklyn.core.effector.EffectorTasks$EffectorBodyTaskFactory$1.call(EffectorTasks.java:82)
>   at 
> org.apache.brooklyn.util.core.task.DynamicSequentialTask$DstJob.call(DynamicSequentialTask.java:359)
>   ... 5 more
> Caused by: java.util.concurrent.ExecutionException: 
> com.google.common.util.concurrent.UncheckedExecutionException: 
> java.lang.IllegalArgumentException: cidrBlock ::/0 is not a valid CIDR
>   at java.util.concurrent.FutureTask.report(FutureTask.java:122)
>   at java.util.concurrent.FutureTask.get(FutureTask.java:188)
>   at 
> com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:63)
>   at org.apache.brooklyn.util.core.task.BasicTask.get(BasicTask.java:361)
>   at 
> org.apache.brooklyn.util.core.task.BasicTask.getUnchecked(BasicTask.java:370)
>   ... 14 more
> Caused by: com.google.co

[jira] [Resolved] (JCLOUDS-1100) OpenStack provisioning fails: exception "cidrBlock ::/0 is not a valid CIDR"

2017-11-25 Thread Reijhanniel Jearl Campos (JIRA)

 [ 
https://issues.apache.org/jira/browse/JCLOUDS-1100?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Reijhanniel Jearl Campos resolved JCLOUDS-1100.
---
Resolution: Fixed

> OpenStack provisioning fails: exception "cidrBlock ::/0 is not a valid CIDR"
> 
>
> Key: JCLOUDS-1100
> URL: https://issues.apache.org/jira/browse/JCLOUDS-1100
> Project: jclouds
>  Issue Type: Bug
>  Components: jclouds-compute
>Affects Versions: 1.9.2
>Reporter: Aled Sage
>Assignee: Zack Shoylev
> Fix For: 2.0.0
>
>
> When provisioning a VM to OpenStack (in IBM's BlueBox), I got the exception 
> below.
> {noformat}
> Failed after 6.11s: Error invoking start at DockerHostImpl{id=uMtN8h3W}: 
> UncheckedExecutionException: java.lang.IllegalArgumentException: cidrBlock 
> ::/0 is not a valid CIDR
> org.apache.brooklyn.core.mgmt.internal.EffectorUtils$EffectorCallPropagatedRuntimeException:
>  Error invoking start at DockerHostImpl{id=uMtN8h3W}: 
> UncheckedExecutionException: java.lang.IllegalArgumentException: cidrBlock 
> ::/0 is not a valid CIDR
>   at 
> org.apache.brooklyn.core.mgmt.internal.EffectorUtils$EffectorCallPropagatedRuntimeException.propagate(EffectorUtils.java:299)
>   at 
> org.apache.brooklyn.core.mgmt.internal.EffectorUtils$EffectorCallPropagatedRuntimeException.access$100(EffectorUtils.java:266)
>   at 
> org.apache.brooklyn.core.mgmt.internal.EffectorUtils.handleEffectorException(EffectorUtils.java:306)
>   at 
> org.apache.brooklyn.core.effector.EffectorTasks$EffectorBodyTaskFactory$2.handleException(EffectorTasks.java:90)
>   at 
> org.apache.brooklyn.util.core.task.DynamicSequentialTask.handleException(DynamicSequentialTask.java:469)
>   at 
> org.apache.brooklyn.util.core.task.DynamicSequentialTask$DstJob.call(DynamicSequentialTask.java:417)
>   at 
> org.apache.brooklyn.util.core.task.BasicExecutionManager$SubmissionCallable.call(BasicExecutionManager.java:518)
>   at java.util.concurrent.FutureTask.run(FutureTask.java:262)
>   at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>   at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>   at java.lang.Thread.run(Thread.java:745)
> Caused by: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: 
> UncheckedExecutionException: java.lang.IllegalArgumentException: cidrBlock 
> ::/0 is not a valid CIDR
>   at 
> org.apache.brooklyn.util.exceptions.Exceptions.propagate(Exceptions.java:128)
>   at 
> org.apache.brooklyn.util.core.task.BasicTask.getUnchecked(BasicTask.java:372)
>   at org.apache.brooklyn.util.core.task.Tasks$2.get(Tasks.java:285)
>   at 
> org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks.preStartAtMachineAsync(MachineLifecycleEffectorTasks.java:412)
>   at 
> org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks.startInLocation(MachineLifecycleEffectorTasks.java:339)
>   at 
> org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks.startInLocations(MachineLifecycleEffectorTasks.java:324)
>   at 
> org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks.start(MachineLifecycleEffectorTasks.java:313)
>   at 
> org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks$StartEffectorBody.call(MachineLifecycleEffectorTasks.java:214)
>   at 
> org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks$StartEffectorBody.call(MachineLifecycleEffectorTasks.java:201)
>   at 
> org.apache.brooklyn.core.effector.EffectorTasks$EffectorBodyTaskFactory$1.call(EffectorTasks.java:82)
>   at 
> org.apache.brooklyn.util.core.task.DynamicSequentialTask$DstJob.call(DynamicSequentialTask.java:359)
>   ... 5 more
> Caused by: java.util.concurrent.ExecutionException: 
> com.google.common.util.concurrent.UncheckedExecutionException: 
> java.lang.IllegalArgumentException: cidrBlock ::/0 is not a valid CIDR
>   at java.util.concurrent.FutureTask.report(FutureTask.java:122)
>   at java.util.concurrent.FutureTask.get(FutureTask.java:188)
>   at 
> com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:63)
>   at org.apache.brooklyn.util.core.task.BasicTask.get(BasicTask.java:361)
>   at 
> org.apache.brooklyn.util.core.task.BasicTask.getUnchecked(BasicTask.java:370)
>   ... 14 more
> Caused by: com.google.co

Re: [jclouds/jclouds-labs] Pb compute api (#292)

2016-10-03 Thread Reijhanniel Jearl Campos
Hello! 

> How close would you say we are to closing this PR

I'd say it's long overdue! Seeing your live tests passing from your gist, I'd 
say the impl addresses the contract required by the `ComputeService`. Just some 
last nitpicks like that [overriden 
toString](https://github.com/jclouds/jclouds-labs/pull/292#discussion_r79763475),
 and the [formatting in 
pom](https://github.com/jclouds/jclouds-labs/pull/292#discussion_r79763965). 
Otherwise, I'd say this LGTM.

/cc @nacx PR now yours for last review?

---
What're your plans btw after this gets merged? I'd personally like to see:
- Arbitrary CPU/RAM support, as this is [now 
supported](https://jclouds.apache.org/blog/2016/08/22/arbitrary-cpu-ram/)
- [JCLOUDS-1082](https://issues.apache.org/jira/browse/JCLOUDS-1082) Firewall 
configurations
- [JCLOUDS-1083](https://issues.apache.org/jira/browse/JCLOUDS-1083) Inbound 
port configurations

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/292#issuecomment-251289003

Re: [jclouds/jclouds-labs] Pb compute api (#292)

2016-09-23 Thread Reijhanniel Jearl Campos
devcsrj commented on this pull request.



> -  properties.setProperty(PROPERTY_ZONE + ".FRA." + ISO3166_CODES, 
> "DE-HE");
-  properties.setProperty(PROPERTY_ZONE + ".LAS." + ISO3166_CODES, "US-NV");
-  properties.setProperty(PROPERTY_ZONE + ".LASDEV." + ISO3166_CODES, 
"US-NV");
-  
+
+  properties.setProperty(PROPERTY_REGIONS, "de,us");
+  properties.setProperty(PROPERTY_REGION + ".de.zones", "de/fkb,de/fra");
+  properties.setProperty(PROPERTY_REGION + ".us.zones", 
"us/las,us/lasdev");
+  properties.setProperty(PROPERTY_ZONES, "de/fkb,de/fra,us/las,us/lasdev");
+  properties.setProperty(PROPERTY_ISO3166_CODES, "DE-BW,DE-HE,US_NV");
+  properties.setProperty(PROPERTY_REGION + ".de." + ISO3166_CODES, 
"DE-BW,DE-HE");
+  properties.setProperty(PROPERTY_REGION + ".us." + ISO3166_CODES, 
"US-NV");
+  properties.setProperty(PROPERTY_ZONE + ".de/fkb." + ISO3166_CODES, 
"DE-BW");
+  properties.setProperty(PROPERTY_ZONE + ".de/fra." + ISO3166_CODES, 
"DE-HE");
+  properties.setProperty(PROPERTY_ZONE + ".us/las." + ISO3166_CODES, 
"US-NV");
+  properties.setProperty(PROPERTY_ZONE + ".us/lasdebv." + ISO3166_CODES, 
"US-NV");

`.us/lasdebv` is this intentional?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/292#pullrequestreview-1307986

Re: [jclouds/jclouds-labs] Pb compute api (#292)

2016-09-23 Thread Reijhanniel Jearl Campos
devcsrj commented on this pull request.



> + logger.trace(">> provisioning complete for server. returned 
> id='%s'", serverId);
+
+  } catch (Exception ex) {
+ logger.error(ex, ">> failed to provision server. rollbacking..");
+ destroyVolumes(volumeIds, dataCenterId);
+ throw Throwables.propagate(ex);
+  }
+
+  waitServerUntilAvailable.apply(ServerRef.create(dataCenterId, serverId));
+  waitDcUntilAvailable.apply(dataCenterId);
+
+  //attach bootVolume to Server
+  api.serverApi().attachVolume(Server.Request.attachVolumeBuilder()
+  .dataCenterId(dataCenterId)
+  .serverId(serverId)
+  .volumeId(bootVolume.id())

> when trying to ssh into the servers and test operations..

O. I guess we'll leave it at that! :)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/292

Re: [jclouds/jclouds-labs] Pb compute api (#292)

2016-09-23 Thread Reijhanniel Jearl Campos
devcsrj commented on this pull request.



> + logger.trace(">> provisioning complete for server. returned 
> id='%s'", serverId);
+
+  } catch (Exception ex) {
+ logger.error(ex, ">> failed to provision server. rollbacking..");
+ destroyVolumes(volumeIds, dataCenterId);
+ throw Throwables.propagate(ex);
+  }
+
+  waitServerUntilAvailable.apply(ServerRef.create(dataCenterId, serverId));
+  waitDcUntilAvailable.apply(dataCenterId);
+
+  //attach bootVolume to Server
+  api.serverApi().attachVolume(Server.Request.attachVolumeBuilder()
+  .dataCenterId(dataCenterId)
+  .serverId(serverId)
+  .volumeId(bootVolume.id())

You didn't make changes in here... I assume this is intentional?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/292

Re: [jclouds/jclouds-labs] Pb compute api (#292)

2016-09-23 Thread Reijhanniel Jearl Campos
devcsrj commented on this pull request.



> + public List call() throws Exception {
+logger.trace("<< fetching snapshots");
+List remoteSnapshots = api.snapshotApi().list(new 
DepthOptions().depth(1));
+logger.trace(">> snapshots feched.");
+
+return remoteSnapshots;
+ }
+
+  });
+
+  return Iterables.concat(getUnchecked(images), getUnchecked(snapshots));
+   }
+
+   @Override
+   public Provisionable getImage(String id
+   ) {

> ..for this approach

Uhm.. Which approach again? (Wrong comment thread?)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/292

Re: [jclouds/jclouds-labs] Pb compute api (#292)

2016-09-20 Thread Reijhanniel Jearl Campos
devcsrj requested changes on this pull request.

Also, could you post a copy of your the build results of this module in a gist, 
or a pastie?

P.S.: Take care, and make sure **not** to include your credentials!

> +  TemplateOptions options = template.getOptions();
+  final String loginUser = isNullOrEmpty(options.getLoginUser()) ? "root" 
: options.getLoginUser();
+  final String password = options.hasLoginPassword() ? 
options.getLoginPassword() : Passwords.generate();
+  final org.jclouds.compute.domain.Image image = template.getImage();
+
+  // provision all volumes based on hardware
+  List volumes = hardware.getVolumes();
+  List volumeIds = 
Lists.newArrayListWithExpectedSize(volumes.size());
+
+  int i = 1;
+  for (final Volume volume : volumes) {
+ try {
+logger.trace("<< provisioning volume '%s'", volume);
+final 
org.apache.jclouds.profitbricks.rest.domain.Volume.Request.CreatePayload 
request = 
org.apache.jclouds.profitbricks.rest.domain.Volume.Request.creatingBuilder()
+.dataCenterId(dataCenterId)
+.image(image.getId())

Is it intentional that here we provision every volume with an image? (i.e.: If 
we attached 5 volumes, each has a bootable OS?)

> + logger.trace(">> provisioning complete for server. returned 
> id='%s'", serverId);
+
+  } catch (Exception ex) {
+ logger.error(ex, ">> failed to provision server. rollbacking..");
+ destroyVolumes(volumeIds, dataCenterId);
+ throw Throwables.propagate(ex);
+  }
+
+  waitServerUntilAvailable.apply(ServerRef.create(dataCenterId, serverId));
+  waitDcUntilAvailable.apply(dataCenterId);
+
+  //attach bootVolume to Server
+  api.serverApi().attachVolume(Server.Request.attachVolumeBuilder()
+  .dataCenterId(dataCenterId)
+  .serverId(serverId)
+  .volumeId(bootVolume.id())

IIRC, if one creates a server (line 193) with the `bootVolume` param set, it'll 
be automatically attached after that server is provisioned. Is this not the 
case anymore?

> + public List call() throws Exception {
+logger.trace("<< fetching snapshots");
+List remoteSnapshots = api.snapshotApi().list(new 
DepthOptions().depth(1));
+logger.trace(">> snapshots feched.");
+
+return remoteSnapshots;
+ }
+
+  });
+
+  return Iterables.concat(getUnchecked(images), getUnchecked(snapshots));
+   }
+
+   @Override
+   public Provisionable getImage(String id
+   ) {

Woops right paren

> DE_FKB("de/fkb", "Germany, Karlsruhe"),
DE_FRA("de/fra", "Germany, Frankfurt (M)"),
US_LAS("us/las", "USA, Las Vegas"),
US_LASDEV("us/lasdev", "USA Developer cluster"),
-   UNRECOGNIZED("unrecognized", "Unrecognized location");
+   UNRECOGNIZED("unrecognized", "Unrecognized location"),
+   Mock("mock", "mock");

[nit] All caps

>return UNRECOGNIZED;
}
+
+   @Override
+   public String toString() {
+  return id;

Make this more descriptive, something like:
```
   return "Location[id=" + id + ", description=" + description + "]";
```

..or don't override it at all, and use the actual `getId()` method, to print 
out the ID.

> @@ -61,9 +66,9 @@
 provided
 
 
-   org.apache.jclouds.driver
-   jclouds-okhttp
-   ${jclouds.version}
+org.apache.jclouds.driver
+jclouds-okhttp
+${jclouds.version}

[nit] Formatting

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/292#pullrequestreview-884467

Re: [jclouds/jclouds-labs] Pb compute api (#292)

2016-09-15 Thread Reijhanniel Jearl Campos
Now that's a **LOT** of formatting noise, even GitHub couldn't render. :(

![](https://cloud.githubusercontent.com/assets/3963900/18572062/51bd9a1c-7bea-11e6-9d97-1a92f8b94a9f.png)

Assuming you used the IDE formatting profiles, then the formatting noise is 
most probably caused by earlier PB-related PRs not formatted properly. i.e.: 
Braces on single-line ifs:

![](https://cloud.githubusercontent.com/assets/3963900/18572146/205b894c-7beb-11e6-9db5-6e85acea279a.png)

..or untrimmed whitespaces:
![](https://cloud.githubusercontent.com/assets/3963900/18572159/47b3cf22-7beb-11e6-87dd-e5aaf9ac81b6.png)

Here's what I suggest, to move this PR into a reviewable state:
- Rebase this branch to `master`
- Re-apply **ONLY** the compute-api related changes, using the correct 
formatting

Don't reformat the rest of the codebase _yet_; only the once you've changed. 
After this gets merged, we'll dedicated a separate PR for the sole purpose of 
reformatting the rest of the codebase. That way we keep the changes to it's own 
PRs, making the review possible.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/292#issuecomment-247495155

Re: [jclouds/jclouds-labs] Pb compute api (#292)

2016-09-08 Thread Reijhanniel Jearl Campos
> +import org.jclouds.compute.domain.Hardware;
> +import org.jclouds.compute.domain.Image;
> +import org.jclouds.compute.domain.NodeMetadata;
> +import org.jclouds.compute.domain.Volume;
> +import org.jclouds.domain.Location;
> +import org.jclouds.functions.IdentityFunction;
> +import org.jclouds.lifecycle.Closer;
> +import org.jclouds.location.suppliers.ImplicitLocationSupplier;
> +import org.jclouds.location.suppliers.implicit.OnlyLocationOrFirstZone;
> +import static org.jclouds.util.Predicates2.retry;
> +
> +public class ProfitBricksComputeServiceContextModule extends
> +ComputeServiceAdapterContextModule Provisionable, DataCenter> {
> +
> +@Override
> +protected void configure() {

Now that jclouds supports arbitrary CPU, RAM and Storage, configure the 
template builder here too! See [blog 
post](https://jclouds.apache.org/blog/2016/08/22/arbitrary-cpu-ram/) for 
details.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/292/files/1533bf29a80f2c87834f501abd91ea399debd688#r78122825

Re: [jclouds/jclouds-labs] Pb compute api (#292)

2016-09-06 Thread Reijhanniel Jearl Campos
> +
> +@Override
> +public DataCenter get() {
> +DataCenter dataCenter = api.create(TEST_DC_NAME, "desc,,,", 
> Location.US_LAS.getId());
> +predicate.apply(dataCenter.id());
> +
> +return api.getDataCenter(dataCenter.id());
> +}
> +});
> +
> +// final TemplateBuilder templateBuilder = 
> view.getComputeService().templateBuilder();
> +//templateBuilder.osFamily(OsFamily.UBUNTU);
> +//templateBuilder.osVersionMatches("16.04");
> +//templateBuilder.locationId(dataCenter.id());
> +//templateBuilder.hardwareId("cpu=4,ram=2,disk=30");
> +//templateBuilder.imageId("02a49ebb-27b7-11e6-8e88-52540005ab80");

Remove these as well

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/292/files/1533bf29a80f2c87834f501abd91ea399debd688#r77746811

Re: [jclouds/jclouds-labs] Pb compute api (#292)

2016-09-06 Thread Reijhanniel Jearl Campos
> +@Test(groups = "live", singleThreaded = true, testName = 
> "ProfitBricksComputeServiceLiveTest")
> +public class ProfitBricksComputeServiceLiveTest extends 
> BaseComputeServiceLiveTest {
> +
> +//private static final String TEST_DC_NAME = "computeServiceLiveTest" + 
> System.currentTimeMillis();
> +private static final String TEST_DC_NAME = "computeServiceLiveTest";
> +
> +private DataCenter dataCenter;
> +
> +public ProfitBricksComputeServiceLiveTest() {
> +provider = "profitbricks-rest";
> +//System.setProperty("http.proxyHost", "127.0.0.1");
> +//System.setProperty("https.proxyHost", "127.0.0.1");
> +//System.setProperty("http.proxyPort", "");
> +//System.setProperty("https.proxyPort", "");
> +//System.setProperty("javax.net.ssl.trustStore", "C:\\Program 
> Files\\Java\\jdk1.8.0_73\\jre\\lib\\security\\FiddlerKeystore");
> +//System.setProperty("javax.net.ssl.trustStorePassword", "testme");

Remove these commented test values (including the `TEST_DC_NAME` field)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/292/files/1533bf29a80f2c87834f501abd91ea399debd688#r77746753

Re: [jclouds/jclouds-labs] Pb compute api (#292)

2016-09-06 Thread Reijhanniel Jearl Campos
> +import org.jclouds.scriptbuilder.statements.java.InstallJDK;
> +import org.jclouds.scriptbuilder.statements.login.AdminAccess;
> +import org.jclouds.ssh.SshClient;
> +import org.jclouds.ssh.SshException;
> +import static org.jclouds.util.Predicates2.retry;
> +import static org.testng.Assert.assertEquals;
> +import static org.testng.Assert.assertFalse;
> +import static org.testng.Assert.assertNotNull;
> +import static org.testng.Assert.assertTrue;
> +import static org.testng.Assert.fail;
> +import org.testng.annotations.AfterClass;
> +import org.testng.annotations.BeforeGroups;
> +import org.testng.annotations.Test;
> +
> +@Test(groups = {"integration", "live"}, singleThreaded = true)
> +public abstract class BaseTest extends BaseComputeServiceContextLiveTest {

The ssh-related issue was already fixed by @nacx with 
[https://github.com/jclouds/jclouds/pull/995], so you can revert the the 
overridden methods in this test class.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/292/files/1533bf29a80f2c87834f501abd91ea399debd688#r77746649

[jira] [Commented] (JCLOUDS-1058) ComputeService cannot cancel tasks in ProfitBricks

2016-09-06 Thread Reijhanniel Jearl Campos (JIRA)

[ 
https://issues.apache.org/jira/browse/JCLOUDS-1058?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15469160#comment-15469160
 ] 

Reijhanniel Jearl Campos commented on JCLOUDS-1058:
---

[~nacx] Shouldn't this be closed with your 
[commit](https://github.com/jclouds/jclouds/pull/995)?

> ComputeService cannot cancel tasks in ProfitBricks
> --
>
> Key: JCLOUDS-1058
> URL: https://issues.apache.org/jira/browse/JCLOUDS-1058
> Project: jclouds
>  Issue Type: Bug
>  Components: jclouds-compute
>Affects Versions: 1.9.2
>Reporter: Ignasi Barrera
>  Labels: profitbricks
>
> Attempting to cancel a task in ProfitBricks results in an 
> Authorization/Timeout exception. Details on how to reproduce and the 
> investigations that have been made can be found here:
> https://github.com/jclouds/jclouds-labs/pull/224#issuecomment-165712742
> {code}
> Exception in thread "main" org.jclouds.rest.AuthorizationException: 
> (root:pw[97db1846570837fce6ff62a408f1d26a]@00.00.00.00:22) 
> (root:pw[97db1846570837fce6ff62a408f1d26a]@00.00.00.00:22) error acquiring 
> {hostAndPort=00.00.00.00:22, loginUser=root, ssh=1533657934, 
> connectTimeout=6, sessionTimeout=6} (out of retries - max 7): 
> Exhausted available authentication methods
> at org.jclouds.sshj.SshjSshClient.propagate(SshjSshClient.java:395)
> at org.jclouds.sshj.SshjSshClient.acquire(SshjSshClient.java:205)
> at org.jclouds.sshj.SshjSshClient.connect(SshjSshClient.java:225)
> at 
> org.jclouds.compute.callables.SudoAwareInitManager.refreshAndRunAction(SudoAwareInitManager.java:74)
> at 
> org.jclouds.compute.callables.BlockUntilInitScriptStatusIsZeroThenReturnOutput.interruptTask(BlockUntilInitScriptStatusIsZeroThenReturnOutput.java:159)
> at 
> com.google.common.util.concurrent.AbstractFuture.cancel(AbstractFuture.java:136)
> at 
> io.devcsrj.report.jclouds.RunScriptUsingBasicLogin.testWeCanCancelTask(RunScriptUsingBasicLogin.java:107)
> at 
> io.devcsrj.report.jclouds.RunScriptUsingBasicLogin.main(RunScriptUsingBasicLogin.java:92)
> Caused by: net.schmizz.sshj.userauth.UserAuthException: Exhausted available 
> authentication methods
> at net.schmizz.sshj.SSHClient.auth(SSHClient.java:217)
> at net.schmizz.sshj.SSHClient.auth(SSHClient.java:193)
> at net.schmizz.sshj.SSHClient.authPassword(SSHClient.java:278)
> at net.schmizz.sshj.SSHClient.authPassword(SSHClient.java:248)
> at net.schmizz.sshj.SSHClient.authPassword(SSHClient.java:232)
> at 
> org.jclouds.sshj.SSHClientConnection.create(SSHClientConnection.java:165)
> at 
> org.jclouds.sshj.SSHClientConnection.create(SSHClientConnection.java:49)
> at org.jclouds.sshj.SshjSshClient.acquire(SshjSshClient.java:195)
> ... 6 more
> Caused by: net.schmizz.sshj.userauth.UserAuthException: Timeout expired
> at 
> net.schmizz.sshj.userauth.UserAuthException$1.chain(UserAuthException.java:33)
> at 
> net.schmizz.sshj.userauth.UserAuthException$1.chain(UserAuthException.java:26)
> at net.schmizz.concurrent.Promise.retrieve(Promise.java:139)
> at 
> net.schmizz.sshj.userauth.UserAuthImpl.authenticate(UserAuthImpl.java:69)
> at net.schmizz.sshj.SSHClient.auth(SSHClient.java:211)
> ... 13 more
> Caused by: java.util.concurrent.TimeoutException: Timeout expired
> ... 16 more
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


Re: [jclouds/jclouds-labs] Pb compute api (#292)

2016-09-06 Thread Reijhanniel Jearl Campos
> +destroyVolume(volumeId, dataCenterId);
> +}
> +}
> +// Last paranoid check
> +waitDcUntilAvailable.apply(dataCenterId);
> +
> +LoginCredentials serverCredentials = LoginCredentials.builder()
> +.user(loginUser)
> +.password(password)
> +.build();
> +String serverInDataCenterId = 
> DataCenterAndId.fromDataCenterAndId(dataCenterId, serverId).slashEncode();
> +rebootNode(serverInDataCenterId);
> +waitServerUntilAvailable.apply(ServerRef.create(dataCenterId, 
> serverId));
> +
> +try {
> +Thread.sleep(9);

Also, why the need for 90-second sleep here? If the provisioning process still 
not done here (*sigh*), adjust instead the default values of the 
`waitServerUntilAvailable` predicate or datacenter, whichever applicable.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/292/files/1533bf29a80f2c87834f501abd91ea399debd688#r77745128

Re: [jclouds/jclouds-labs] Pb compute api (#292)

2016-09-06 Thread Reijhanniel Jearl Campos
> +}
> +// Last paranoid check
> +waitDcUntilAvailable.apply(dataCenterId);
> +
> +LoginCredentials serverCredentials = LoginCredentials.builder()
> +.user(loginUser)
> +.password(password)
> +.build();
> +String serverInDataCenterId = 
> DataCenterAndId.fromDataCenterAndId(dataCenterId, serverId).slashEncode();
> +rebootNode(serverInDataCenterId);
> +waitServerUntilAvailable.apply(ServerRef.create(dataCenterId, 
> serverId));
> +
> +try {
> +Thread.sleep(9);
> +} catch (InterruptedException ex) {
> +
> java.util.logging.Logger.getLogger(ProfitBricksComputeServiceAdapter.class.getName()).log(Level.SEVERE,
>  null, ex);

Use the injected `logger` field

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/292/files/1533bf29a80f2c87834f501abd91ea399debd688#r77744876

Re: [jclouds/jclouds-labs] Pb compute api (#292)

2016-09-06 Thread Reijhanniel Jearl Campos
> +return api.serverApi().attachVolume(
> +Server.Request.attachVolumeBuilder()
> +.dataCenterId(dataCenterId)
> +.serverId(serverId)
> +.volumeId(volumeId)
> +.build()
> +);
> +}
> +}));
> +
> +logger.trace(">> volume connected.");
> +} catch (Exception ex) {
> +// delete unconnected volume
> +logger.warn(ex, ">> failed to connect volume '%s'. 
> deleting..", volumeId);
> +destroyVolume(volumeId, dataCenterId);
> +}

Prior this volume-creating code block, a 
[*bootVolume*](https://github.com/jclouds/jclouds-labs/pull/292/files#diff-3cfe9775f2121ca815ae0fce43f9d211R187)
 is attached to the server. That server-volume pair already constitutes a 
jcloud node. The additional volumes here are more like, additional storages, 
not necessarily making the node unusable if they fail in attaching.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/292/files/9251ab7434bcafb1dcbec5a718acc3c24517c94d#r77744780

Re: [jclouds/jclouds-labs] Pb compute api (#292)

2016-09-06 Thread Reijhanniel Jearl Campos
> +final String password = "LTbAHNbcMt";
> +
> +//final org.jclouds.compute.domain.Image image = template.getImage();
> +
> +// provision all volumes based on hardware
> +List volumes = hardware.getVolumes();
> +List volumeIds = 
> Lists.newArrayListWithExpectedSize(volumes.size());
> +
> +int i = 1;
> +for (final Volume volume : volumes) {
> +try {
> +logger.trace("<< provisioning volume '%s'", volume);
> +final 
> org.apache.jclouds.profitbricks.rest.domain.Volume.Request.CreatePayload 
> request = 
> org.apache.jclouds.profitbricks.rest.domain.Volume.Request.creatingBuilder()
> +.dataCenterId(dataCenterId)
> +// put image to first volume
> +.image("02a49ebb-27b7-11e6-8e88-52540005ab80")

Take the image id from the template options instead

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/292/files/1533bf29a80f2c87834f501abd91ea399debd688#r77744368

Re: [jclouds/jclouds-labs] Pb compute api (#292)

2016-09-06 Thread Reijhanniel Jearl Campos
> +this.provisioningManager = provisioningManager;
> +}
> +
> +private void SetDataCenterId(String id) {
> +dataCenterId = id;
> +}
> +
> +@Override
> +public NodeAndInitialCredentials 
> createNodeWithGroupEncodedIntoName(String group, String name, Template 
> template) {
> +final String dataCenterId = template.getLocation().getId();
> +SetDataCenterId(dataCenterId);
> +Hardware hardware = template.getHardware();
> +TemplateOptions options = template.getOptions();
> +final String loginUser = isNullOrEmpty(options.getLoginUser()) ? 
> "root" : options.getLoginUser();
> +//final String password = options.hasLoginPassword() ? 
> options.getLoginPassword() : Passwords.generate();
> +final String password = "LTbAHNbcMt";

Is... this password suppose to be here?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/292/files/1533bf29a80f2c87834f501abd91ea399debd688#r77744270

Re: [jclouds/jclouds-labs] Pb compute api (#292)

2016-09-06 Thread Reijhanniel Jearl Campos
Hi @alibazlamit !

The initial comments on this PR haven't been addressed yet; see [Files 
Changed](https://github.com/jclouds/jclouds-labs/pull/292/files) tab of this 
PR, most notably style-checks. The diff made it looked like that this PR 
changed *everything* due to the formatting changes. While this does not 
necessarily break code correctness, reviewing becomes 10x more times difficult 
(actually, 5700+ additions ;) ), as we're *might* be seeing changes not 
intentionally addressed by this PR (i.e.: Compute Service).

Could you take care of that first, by removing the disabled 
``s, and reformatting the source? If you're using eclipse or 
idea, they have a profile you can format 
[here](https://cwiki.apache.org/confluence/display/JCLOUDS/Coding+Standards).

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/292#issuecomment-245140170

Re: [jclouds/jclouds] Do not try to connect to ssh if already connected (#995)

2016-08-12 Thread Reijhanniel Jearl Campos
Oh, this workaround might do the trick.

P.S.: My trial account in PB got expired though. I'll see what I could do.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/995#issuecomment-239414735

Re: [jclouds/jclouds-labs] Pb compute api (#292)

2016-07-05 Thread Reijhanniel Jearl Campos
Hmm. Now this kinda sucks. I was under the impression before that this 
exception [only 
occurred](https://github.com/jclouds/jclouds-labs/pull/224#issuecomment-172719660)
 for the SOAP version of the API (that maybe the REST API did a few more stuff 
in the PB backend to prevent this). 

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/292#issuecomment-230458541

Re: [jclouds/jclouds] JCLOUDS-1078: Implement ImageExtension in ProfitBricks (#929)

2016-05-01 Thread Reijhanniel Jearl Campos
Closed #929.

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/929#event-647082738

Re: [jclouds-labs] Volume API SSH keys (#245)

2016-03-07 Thread Reijhanniel Jearl Campos
Nice! With this, pre-configuring password-ready images will no longer be 
needed. +1

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

Re: [jclouds] JCLOUDS-1078: Implement ImageExtension in ProfitBricks (#929)

2016-03-02 Thread Reijhanniel Jearl Campos
Whew. Now I'm relieved that this is not a *bugfoot*. After attaching the 
debugger one more time, I found out that the `AuthenticationException` was 
caused by the `ProfitBricksComputeServiceAdapter` [generating a 
password](https://github.com/devcsrj/jclouds/commit/1391384dd5d58e5ccbe91ca4f5fb8c0f63800fb8#diff-6af74fe6e33ae1d12faae140fee688d2L118),
 if none is provided. This doesn't make sense to snapshots.

The latest commit sets loginUser and password as null for snapshots, so that 
[no `LoginCredentials` is 
created](https://github.com/devcsrj/jclouds/commit/1391384dd5d58e5ccbe91ca4f5fb8c0f63800fb8#diff-6af74fe6e33ae1d12faae140fee688d2R241).

```
testSpawnNodeFromImage(org.jclouds.profitbricks.compute.extensions.ProfitBricksImageExtensionLiveTest)
  Time elapsed: 329.445 sec  <<< FAILURE!
java.lang.NullPointerException: no credentials found for node 
81a0ee10-7c64-4129-bf8a-68c14afc8cd7
at 
com.google.common.base.Preconditions.checkNotNull(Preconditions.java:253)
at 
org.jclouds.compute.functions.CreateSshClientOncePortIsListeningOnNode.apply(CreateSshClientOncePortIsListeningOnNode.java:62)
at 
org.jclouds.compute.functions.CreateSshClientOncePortIsListeningOnNode.apply(CreateSshClientOncePortIsListeningOnNode.java:40)
at 
org.jclouds.compute.extensions.internal.BaseImageExtensionLiveTest.checkReachable(BaseImageExtensionLiveTest.java:167)
at 
org.jclouds.compute.extensions.internal.BaseImageExtensionLiveTest.testSpawnNodeFromImage(BaseImageExtensionLiveTest.java:136)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at 
org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:696)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:882)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1189)
at 
org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:124)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
```

My question, what's the cleanest approach to set the credentials for the newly 
created image? Or should the [test 
method](https://github.com/jclouds/jclouds/blob/master/compute/src/test/java/org/jclouds/compute/extensions/internal/BaseImageExtensionLiveTest.java#L134)
 be updated?

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

Re: [jclouds] JCLOUDS-1078: Implement ImageExtension in ProfitBricks (#929)

2016-03-02 Thread Reijhanniel Jearl Campos
> ++ cloneTemplate.getName());
> + }
> +  });
> +   }
> +
> +   @Override
> +   public boolean deleteImage(String id) {
> +  Snapshot snapshot = api.snapshotApi().getSnapshot(id);
> +  if (snapshot != null)
> + try {
> +logger.debug(">> deleting snapshot %s..", id);
> +return api.snapshotApi().deleteSnapshot(id);
> + } catch (Exception ex) {
> +logger.error(ex, ">> error deleting snapshot %s..", id);
> + }
> +  return true;

Oh. Nice catch!

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

[jclouds] JCLOUDS-1078: Implement ImageExtension in ProfitBricks (#929)

2016-03-02 Thread Reijhanniel Jearl Campos
This PR mainly implements ImageExtension (Snapshots) in ProfitBricks. Some of 
the compute service property names were renamed as well, to reflect more 
closely the jclouds convention.

The live tests are failing though, with the exact stack traces from 
[JCLOUDS-1058](https://issues.apache.org/jira/browse/JCLOUDS-1058). Had tried 
ubuntu-15.10 on `de/fkb` and `de/fra` so far. I have yet to try for `us/las` 
and `us/lasdev` and see if I can get pass this error.

```
 mvn clean install -Plive -Dtest.profitbricks.identity= 
-Dtest.profitbricks.credential= 
-Dtest.profitbricks.template="imageId=,loginUser=root:" 
-Dtest=org.jclouds.profitbricks.compute.extensions.ProfitBricksImageExtensionLiveTest
```
You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * JCLOUDS-1078: Implement ImageExtension in ProfitBricks

-- File Changes --

M 
providers/profitbricks/src/main/java/org/jclouds/profitbricks/ProfitBricksProviderMetadata.java
 (17)
M 
providers/profitbricks/src/main/java/org/jclouds/profitbricks/compute/ProfitBricksComputeServiceAdapter.java
 (4)
M 
providers/profitbricks/src/main/java/org/jclouds/profitbricks/compute/concurrent/ProvisioningJob.java
 (4)
M 
providers/profitbricks/src/main/java/org/jclouds/profitbricks/compute/config/ProfitBricksComputeServiceContextModule.java
 (59)
A 
providers/profitbricks/src/main/java/org/jclouds/profitbricks/compute/extensions/ProfitBricksImageExtension.java
 (139)
M 
providers/profitbricks/src/main/java/org/jclouds/profitbricks/compute/strategy/AssignDataCenterToTemplate.java
 (4)
M 
providers/profitbricks/src/main/java/org/jclouds/profitbricks/config/ProfitBricksComputeProperties.java
 (6)
M 
providers/profitbricks/src/test/java/org/jclouds/profitbricks/BaseProfitBricksLiveTest.java
 (8)
A 
providers/profitbricks/src/test/java/org/jclouds/profitbricks/compute/extensions/ProfitBricksImageExtensionLiveTest.java
 (37)

-- Patch Links --

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

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


Re: [jclouds-labs] Profitbricks REST - Image API (#242)

2016-03-01 Thread Reijhanniel Jearl Campos
I have no numbers to determine how many users are currently using/will use 
those image UD operations via jclouds (if this argument make sense).

If this were a vote, I'd say remove the update and delete methods, because 
there's no way we can write an *acceptable* live test for 'em anyway. Even if a 
REST endpoint for upload image is added, I don't think waiting for the upload 
live test of a [50MB](http://www.damnsmalllinux.org/) image (smallest I can 
find) is feasible. :smile: 

With that said, now that the missing mock tests were added, this already LGTM, 
if you decide to just keep only getImage/s operations. 

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

Re: [jclouds-labs] Profitbricks REST - Image API (#242)

2016-02-29 Thread Reijhanniel Jearl Campos
> +   }
> +   
> +   @Test
> +   public void testDelete() throws InterruptedException {
> +  server.enqueue(
> + new MockResponse().setBody("")
> +  );
> +  
> +  imageApi().deleteImage("some-id");
> +  assertEquals(server.getRequestCount(), 1);
> +  assertSent(server, "DELETE", "/images/some-id");
> +   }
> +
> +   private ImageApi imageApi() {
> +  return api.imageApi();
> +   }

> Rule of thumb is: if your method has a @Fallback annotation, it needs a test. 
> Otherwise, fallback test is not needed.

+1.

So in this case: a 404/401 test won't be needed for `updateImage`, because it 
doesn't have a declared fallback (and jclouds will propagate an appropriate 
exception), but we need one for `getImage`, so that we can verify that the 
method's behavior indeed returns an empty list, instead of a 
`ResourceNotFoundException`/`AuthorizationException`.  

I got confused with this as well. Sorry for the confusion, @mirza-spc !

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

Re: [jclouds-labs] Profitbricks REST - Image API (#241)

2016-02-29 Thread Reijhanniel Jearl Campos
Closed #241.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/241#event-571162982

Re: [jclouds-labs] Profitbricks REST - Image API (#241)

2016-02-29 Thread Reijhanniel Jearl Campos
Closing PR, now superseded by #242 .

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

Re: [jclouds-labs] Profitbricks REST - Image API (#242)

2016-02-29 Thread Reijhanniel Jearl Campos
> +  assertEquals(image.id(), testImageId);
> +  assertEquals(image.properties().name(), 
> "ubuntu-14.04.3-server-amd64.iso");
> +   }
> +   
> +   @Test
> +   public void testList() {
> +  List images = imageApi().getList();
> +
> +  assertNotNull(images);
> +  assertFalse(images.isEmpty());
> +  assertTrue(images.size() > 1);
> +   }
> +   
> +   private ImageApi imageApi() {
> +  return api.imageApi();
> +   }

He might be pertaining to methods with the `DepthOptions` param (getList, 
getImage). :)

About the *update* and *delete* operations: Since the PB API doesn't have an 
endpoint to actually upload images (was this via FTP, IIRC?), would it make 
sense if we just remove these operations, and just leave the `GET` requests to 
keep it simple? This is the case for the [soap 
counterpart](https://github.com/jclouds/jclouds/blob/master/providers/profitbricks/src/main/java/org/jclouds/profitbricks/features/ImageApi.java#L42).
 Although I'm not aware as to how many users would actually depend on this 
feature, so... thoughts?

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

Re: [jclouds-labs] Profitbricks REST - Image API (#242)

2016-02-29 Thread Reijhanniel Jearl Campos
> +   }
> +   
> +   @Test
> +   public void testDelete() throws InterruptedException {
> +  server.enqueue(
> + new MockResponse().setBody("")
> +  );
> +  
> +  imageApi().deleteImage("some-id");
> +  assertEquals(server.getRequestCount(), 1);
> +  assertSent(server, "DELETE", "/images/some-id");
> +   }
> +
> +   private ImageApi imageApi() {
> +  return api.imageApi();
> +   }

Hi @mirza-spc ! You're right, there's no need to test for 404 fallbacks. :)

In this case, @nacx might've meant, the tests for the methods with 
`DepthOptions` param, like for getList and getImage.

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

Re: [jclouds-labs] Profitbricks REST - Volume API (#233)

2016-02-26 Thread Reijhanniel Jearl Campos
Yes! This has been pushed to master. You may now rebase the other PR. 

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

Re: [jclouds] Properly handler ProfitBricks service errors (#928)

2016-02-25 Thread Reijhanniel Jearl Campos
+1. Thanks for the fix @nacx ! :)

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

Re: [jclouds] Fix ProfitBricks TemplateBuilderLiveTests (#927)

2016-02-23 Thread Reijhanniel Jearl Campos
+1

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

Re: [jclouds-site] Promote ProfitBricks (#180)

2016-02-23 Thread Reijhanniel Jearl Campos
Change [deployed](http://svn.apache.org/viewvc?view=revision=1731869).

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

Re: [jclouds-labs] Profitbricks REST - Volume API (#233)

2016-02-23 Thread Reijhanniel Jearl Campos
Woops, missed that. Pushed a 
[commit](https://github.com/jclouds/jclouds-labs/commit/5bd8447b28fe8b0b7a2b85b03270de643a6a62c0)
 to remove the dep.

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

Re: [jclouds-labs] Profitbricks REST - Image API (#241)

2016-02-23 Thread Reijhanniel Jearl Campos
Hi!

Now that the #233 is merged, could you rebase this branch so that only the 
image api-related commit is on top of master? You can verify this via [**Files 
changed**](https://github.com/jclouds/jclouds-labs/pull/241/files) tab.

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

Re: [jclouds-labs] Profitbricks REST - Volume API (#233)

2016-02-23 Thread Reijhanniel Jearl Campos
Closed #233.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/233#event-561546517

Re: [jclouds-labs] Profitbricks REST - Volume API (#233)

2016-02-23 Thread Reijhanniel Jearl Campos
Pushed to master as 
[9a8b346](https://github.com/jclouds/jclouds-labs/commit/9a8b346cafd9e332b0e532f1341e739d0388a347).
 Thanks for the effort, @mirza-spc !

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

Re: [jclouds] Move html responses to a subfolder for cleaner rat plugin exclude (#924)

2016-02-23 Thread Reijhanniel Jearl Campos
Pushed to master as 
[9a8b4d](https://github.com/jclouds/jclouds/commit/9a8b4d074b50727e98f508a549550037322bcbd0).

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

Re: [jclouds] Move html responses to a subfolder for cleaner rat plugin exclude (#924)

2016-02-23 Thread Reijhanniel Jearl Campos
Closed #924.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/924#event-561480999

Re: [jclouds-labs] Profitbricks REST - Volume API (#233)

2016-02-22 Thread Reijhanniel Jearl Campos
Hmm. Unfortunately, this branch needs to be rebased and squashed, such that it 
contains one commit with changes only related to this PR. You'll notice that 
old files, such as 
[this](https://github.com/jclouds/jclouds-labs/pull/233/files#diff-5f712604f84e8ddc5e1fb9ca7f759697R51)
 no longer exists in `jclouds/jclouds-labs`, but is existing here. 

I'll try to rebase later so that this gets merged, and we can proceed to #241 .

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

[jclouds] Update profitbricks readme to reflect previous refactoring changes (#925)

2016-02-19 Thread Reijhanniel Jearl Campos

You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * Update profitbricks readme to reflect previous refactoring changes

-- File Changes --

M providers/profitbricks/README.md (2)

-- Patch Links --

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

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


Re: [jclouds-site] Promote ProfitBricks (#180)

2016-02-19 Thread Reijhanniel Jearl Campos
Updated. Will create a PR to update README in jclouds main too 

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

[jclouds-karaf] Promote ProfitBricks (#76)

2016-02-19 Thread Reijhanniel Jearl Campos

You can view, comment on, or merge this pull request online at:

  https://github.com/jclouds/jclouds-karaf/pull/76

-- Commit Summary --

  * Promote ProfitBricks

-- File Changes --

M feature/src/main/resources/feature.xml (2)

-- Patch Links --

https://github.com/jclouds/jclouds-karaf/pull/76.patch
https://github.com/jclouds/jclouds-karaf/pull/76.diff

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


[jclouds-site] Promote ProfitBricks (#180)

2016-02-19 Thread Reijhanniel Jearl Campos

You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * Promote ProfitBricks

-- File Changes --

M reference/providers.md (2)

-- Patch Links --

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

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


[jclouds-labs] Remove ProfitBricks (#238)

2016-02-19 Thread Reijhanniel Jearl Campos
Promoted to main repo
You can view, comment on, or merge this pull request online at:

  https://github.com/jclouds/jclouds-labs/pull/238

-- Commit Summary --

  * Remove ProfitBricks

-- File Changes --

M pom.xml (1)
D profitbricks/README.md (61)
D profitbricks/pom.xml (151)
D profitbricks/src/main/java/org/jclouds/profitbricks/ProfitBricksApi.java 
(64)
D 
profitbricks/src/main/java/org/jclouds/profitbricks/ProfitBricksApiMetadata.java
 (85)
D 
profitbricks/src/main/java/org/jclouds/profitbricks/ProfitBricksProviderMetadata.java
 (114)
D 
profitbricks/src/main/java/org/jclouds/profitbricks/binder/BaseProfitBricksRequestBinder.java
 (75)
D 
profitbricks/src/main/java/org/jclouds/profitbricks/binder/datacenter/CreateDataCenterRequestBinder.java
 (44)
D 
profitbricks/src/main/java/org/jclouds/profitbricks/binder/datacenter/UpdateDataCenterRequestBinder.java
 (44)
D 
profitbricks/src/main/java/org/jclouds/profitbricks/binder/drive/AddRomDriveToServerRequestBinder.java
 (45)
D 
profitbricks/src/main/java/org/jclouds/profitbricks/binder/firewall/AddFirewallRuleToNicRequestBinder.java
 (53)
D 
profitbricks/src/main/java/org/jclouds/profitbricks/binder/firewall/FirewallBinder.java
 (95)
D 
profitbricks/src/main/java/org/jclouds/profitbricks/binder/loadbalancer/CreateLoadBalancerRequestBinder.java
 (50)
D 
profitbricks/src/main/java/org/jclouds/profitbricks/binder/loadbalancer/DeregisterLoadBalancerRequestBinder.java
 (42)
D 
profitbricks/src/main/java/org/jclouds/profitbricks/binder/loadbalancer/RegisterLoadBalancerRequestBinder.java
 (44)
D 
profitbricks/src/main/java/org/jclouds/profitbricks/binder/loadbalancer/UpdateLoadBalancerRequestBinder.java
 (44)
D 
profitbricks/src/main/java/org/jclouds/profitbricks/binder/nic/CreateNicRequestBinder.java
 (46)
D 
profitbricks/src/main/java/org/jclouds/profitbricks/binder/nic/SetInternetAccessBinder.java
 (42)
D 
profitbricks/src/main/java/org/jclouds/profitbricks/binder/nic/UpdateNicRequestBinder.java
 (46)
D 
profitbricks/src/main/java/org/jclouds/profitbricks/binder/server/CreateServerRequestBinder.java
 (57)
D 
profitbricks/src/main/java/org/jclouds/profitbricks/binder/server/UpdateServerRequestBinder.java
 (56)
D 
profitbricks/src/main/java/org/jclouds/profitbricks/binder/snapshot/CreateSnapshotRequestBinder.java
 (44)
D 
profitbricks/src/main/java/org/jclouds/profitbricks/binder/snapshot/RollbackSnapshotRequestBinder.java
 (43)
D 
profitbricks/src/main/java/org/jclouds/profitbricks/binder/snapshot/UpdateSnapshotRequestBinder.java
 (53)
D 
profitbricks/src/main/java/org/jclouds/profitbricks/binder/storage/ConnectStorageToServerRequestBinder.java
 (45)
D 
profitbricks/src/main/java/org/jclouds/profitbricks/binder/storage/CreateStorageRequestBinder.java
 (46)
D 
profitbricks/src/main/java/org/jclouds/profitbricks/binder/storage/UpdateStorageRequestBinder.java
 (47)
D 
profitbricks/src/main/java/org/jclouds/profitbricks/compute/ProfitBricksComputeServiceAdapter.java
 (483)
D 
profitbricks/src/main/java/org/jclouds/profitbricks/compute/concurrent/ProvisioningJob.java
 (62)
D 
profitbricks/src/main/java/org/jclouds/profitbricks/compute/concurrent/ProvisioningManager.java
 (88)
D 
profitbricks/src/main/java/org/jclouds/profitbricks/compute/config/ProfitBricksComputeServiceContextModule.java
 (223)
D 
profitbricks/src/main/java/org/jclouds/profitbricks/compute/function/ProvisionableToImage.java
 (241)
D 
profitbricks/src/main/java/org/jclouds/profitbricks/compute/function/ServerToNodeMetadata.java
 (168)
D 
profitbricks/src/main/java/org/jclouds/profitbricks/compute/function/StorageToVolume.java
 (47)
D 
profitbricks/src/main/java/org/jclouds/profitbricks/compute/strategy/AssignDataCenterToTemplate.java
 (110)
D 
profitbricks/src/main/java/org/jclouds/profitbricks/compute/strategy/TemplateWithDataCenter.java
 (107)
D 
profitbricks/src/main/java/org/jclouds/profitbricks/config/ProfitBricksComputeProperties.java
 (32)
D 
profitbricks/src/main/java/org/jclouds/profitbricks/config/ProfitBricksHttpApiModule.java
 (70)
D 
profitbricks/src/main/java/org/jclouds/profitbricks/domain/AvailabilityZone.java
 (32)
D 
profitbricks/src/main/java/org/jclouds/profitbricks/domain/DataCenter.java (121)
D profitbricks/src/main/java/org/jclouds/profitbricks/domain/Drive.java (55)
D profitbricks/src/main/java/org/jclouds/profitbricks/domain/Firewall.java 
(188)
D profitbricks/src/main/java/org/jclouds/profitbricks/domain/Image.java 
(128)
D profitbricks/src/main/java/org/jclouds/profitbricks/domain/IpBlock.java 
(103)
D 
profitbricks/src/main/java/org/jclouds/profitbricks/domain/LoadBalancer.java 
(257)
D profitbricks/src/main/java/org/jclouds/profitbricks/domain/Location.java 
(60)
D profitbricks/src/main/java/org/jclouds/profitbricks/domain/Nic.java (248)
D 

[jclouds] Move html responses to a subfolder for cleaner rat plugin exclude (#924)

2016-02-19 Thread Reijhanniel Jearl Campos

You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * Move html responses to a subfolder for cleaner rat plugin exclude

-- File Changes --

M .gitignore (4)
M project/pom.xml (3)
M 
providers/profitbricks/src/test/java/org/jclouds/profitbricks/http/ResponseStatusFromPayloadHttpCommandExecutorServiceTest.java
 (4)
R providers/profitbricks/src/test/resources/html/fault-401.html (0)
R providers/profitbricks/src/test/resources/html/maintenance-503.html (0)

-- Patch Links --

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

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


[jira] [Created] (JCLOUDS-1083) Allow configuration of ProfitBricks inbound ports via TemplateOptions

2016-02-18 Thread Reijhanniel Jearl Campos (JIRA)
Reijhanniel Jearl Campos created JCLOUDS-1083:
-

 Summary: Allow configuration of ProfitBricks inbound ports via 
TemplateOptions
 Key: JCLOUDS-1083
 URL: https://issues.apache.org/jira/browse/JCLOUDS-1083
 Project: jclouds
  Issue Type: Improvement
  Components: jclouds-compute
Affects Versions: 1.9.2
Reporter: Reijhanniel Jearl Campos


ProfitBricks supports firewall configurations, so 
TemplateOptions#inboundPorts[1] for the TemplateBuilder must be honored.


[1] 
https://github.com/jclouds/jclouds/blob/master/compute/src/main/java/org/jclouds/compute/options/TemplateOptions.java#L620



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (JCLOUDS-1082) Implement SecurityGroupExtensions in ProfitBricks

2016-02-18 Thread Reijhanniel Jearl Campos (JIRA)
Reijhanniel Jearl Campos created JCLOUDS-1082:
-

 Summary: Implement SecurityGroupExtensions in ProfitBricks
 Key: JCLOUDS-1082
 URL: https://issues.apache.org/jira/browse/JCLOUDS-1082
 Project: jclouds
  Issue Type: Improvement
  Components: jclouds-compute
Affects Versions: 1.9.2
Reporter: Reijhanniel Jearl Campos


ProfitBricks supports creation and configuration of firewalls, like security 
groups from Amazon[2].

Implement SecurityGroupExtension[3].

[1] https://www.profitbricks.com/help/Firewall
[2] 
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html
[3] 
https://github.com/jclouds/jclouds/blob/master/compute/src/main/java/org/jclouds/compute/extensions/SecurityGroupExtension.java



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


Re: [jclouds-labs] Profitbricks REST - Volume API (#233)

2016-02-17 Thread Reijhanniel Jearl Campos
Binder tests, :heavy_check_mark: ! Unless @nacx has further comments, this 
LGTM! 

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

Re: [jclouds-labs] Refactored ProfitBricks locations to not rely on existing DataCenters (#235)

2016-02-17 Thread Reijhanniel Jearl Campos
Man you're a magician! :+1: 

The way you did the *create-datacenter-if-not-exist* was awesome. Wasn't 
familiar with how `CreateNodesWithGroupEncodedIntoNameThenAddToSet` worked 
before, and your [custom 
impl](https://github.com/jclouds/jclouds-labs/pull/235/files#diff-2de75f6f337c46cc3ee37511896f795fR57)
 gave me a lot of context.

Just one thing I'd like to ask, how did you get the correct ISO codes for the 
locations? (i.e.: `DE-BW`, `DE-HE`, `US-NV`)? I remember 
[asking](https://botbot.me/freenode/jclouds/2014-12-20/?msg=28000713=1) 
for this before (and still couldn't find a list now) and was only able to 
determine, `DE` for Germany, etc. Did you manually 
[match](https://www.iso.org/obp/ui/#iso:code:3166:DE), like look at a map or 
something? :smiley: 

[nit] Just some typos in the 
[`TemplateWithDataCenter`](https://github.com/jclouds/jclouds-labs/pull/235/files#diff-3db81757e47ede67f080ce2a0d44aef1R43).

This **definitely** needs to get merged before the promotion. Some serious 
refactoring stuff you did here. Thanks @nacx !

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

Re: [jclouds-labs] Profitbricks REST - Volume API (#233)

2016-02-16 Thread Reijhanniel Jearl Campos
Thanks for the `injector`-approach @nacx !

@mirza-spc I noticed that there are missing test in the 
[`-Binder`](https://github.com/StackPointCloud/jclouds-labs/tree/profitbricks-volume-api/profitbricks-rest/src/main/java/org/apache/jclouds/profitbricks/rest/binder)
 classes. Could you add tests for these so that we can verify as to whether 
those binders actually build the correct payload? (I for one usually *trip* on 
these types, like typos in property names, etc. :) ) After that, this PR looks 
good to me! 

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

Re: [jclouds-labs] Profitbricks REST - Volume API (#233)

2016-02-10 Thread Reijhanniel Jearl Campos
> +   @Override
> +   protected String createPayload(Volume.Request.UpdatePayload payload) {
> +
> +  dataCenterId = payload.dataCenterId();
> +  volumeId = payload.id();
> +  
> +  if (payload.name() != null)
> + requestBuilder.put("name",  payload.name());
> +  
> +  if (payload.size() != null)
> + requestBuilder.put("size",  payload.size());
> +  
> +  if (payload.bus() != null)
> + requestBuilder.put("bus",  payload.bus());
> +  
> +  return (new Gson()).toJson(requestBuilder);

Use `Json` here too.

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

Re: [jclouds-labs] Profitbricks REST - Volume API (#233)

2016-02-10 Thread Reijhanniel Jearl Campos
> + properties.put("bus", payload.bus());
> +  
> +  if (payload.type() != null)
> + properties.put("type", payload.type());
> +  
> +  if (payload.imagePassword() != null)
> + properties.put("imagePassword", payload.imagePassword());
> +  
> +  if (payload.image() != null)
> + properties.put("image", payload.image());
> +  else if (payload.licenceType() != null)
> + properties.put("licenceType", payload.licenceType());
> +  
> +  requestBuilder.put("properties", properties);
> +  
> +  return (new Gson()).toJson(requestBuilder);

Use the `Json` object, as you did with 
[here](https://github.com/jclouds/jclouds-labs/blob/master/profitbricks-rest/src/main/java/org/apache/jclouds/profitbricks/rest/binder/server/AttachCdromRequestBinder.java#L52).

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

Re: [jclouds-labs] Profitbricks REST - Volume API (#233)

2016-02-10 Thread Reijhanniel Jearl Campos
> +   @Named("volume:delete")
> +   @DELETE
> +   @Path("/{volumeId}")
> +   @Fallback(Fallbacks.VoidOnNotFoundOr404.class)
> +   void deleteVolume(@PathParam("dataCenterId") String dataCenterId, 
> @PathParam("volumeId") String volumeId);
> +   
> +   @Named("volume:snapshot:create")
> +   @POST
> +   @MapBinder(CreateSnapshotRequestBinder.class)
> +   @ResponseParser(SnapshotApi.SnapshotParser.class)
> +   Snapshot createSnapshot(@PayloadParam("snapshot") 
> Volume.Request.CreateSnapshotPayload payload);
> +   
> +   @Named("volume:snapshot:restore")
> +   @POST
> +   @MapBinder(RestoreSnapshotRequestBinder.class)
> +   @Fallback(Fallbacks.VoidOnNotFoundOr404.class)

Remove fallback. Let's let the user know why the *restore* op failed 

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

Re: [jclouds-labs] Profitbricks REST - Volume API (#233)

2016-02-10 Thread Reijhanniel Jearl Campos
> @@ -65,7 +65,7 @@ public void testGetListWithDepth() throws 
> InterruptedException {
> 
> @Test
> public void testGetListWith404() throws InterruptedException {

You may remove the test for 404 fallback, as this is already tested in the core.

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

Re: [jclouds-labs] Profitbricks REST - Volume API (#233)

2016-02-10 Thread Reijhanniel Jearl Campos
> +  MockResponse response = new MockResponse();
> +  response.setBody(stringFromResource("/volume/get.json"));
> +  response.setHeader("Content-Type", 
> "application/vnd.profitbricks.resource+json");
> +  
> +  server.enqueue(response);
> +  
> +  Volume volume = volumeApi().getVolume("datacenter-id", "some-id");
> +  
> +  assertNotNull(volume);
> +  assertEquals(volume.properties().name(), "Docker Registry Volume");
> +  
> +  assertEquals(server.getRequestCount(), 1);
> +  assertSent(server, "GET", 
> "/datacenters/datacenter-id/volumes/some-id");
> +   }
> +   
> +   public void testGetVolumeWith404() throws InterruptedException {

No need for this too.

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

Re: [jclouds-labs] Profitbricks REST - Volume API (#233)

2016-02-10 Thread Reijhanniel Jearl Campos
> +  server.enqueue(
> + new MockResponse().setBody(stringFromResource("/volume/list.json"))
> +  );
> +  
> +  List list = volumeApi().getList("datacenter-id");
> +  
> +  assertNotNull(list);
> +  assertEquals(list.size(), 6);
> +  assertEquals(list.get(0).properties().name(), "Docker Registry 
> Volume");
> +  
> +  assertEquals(server.getRequestCount(), 1);
> +  assertSent(server, "GET", "/datacenters/datacenter-id/volumes");
> +   }
> +   
> +   @Test
> +   public void testGetListWith404() throws InterruptedException {

No need to test this (already expected to return an empty list, because of the 
declared, already-tested fallback)

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

Re: [jclouds-labs] Profitbricks REST - Volume API (#233)

2016-02-10 Thread Reijhanniel Jearl Campos
> + * limitations under the License.
> + */
> +package org.apache.jclouds.profitbricks.rest.features;
> +
> +import com.squareup.okhttp.mockwebserver.MockResponse;
> +import java.util.List;
> +import org.apache.jclouds.profitbricks.rest.domain.LicenceType;
> +import org.apache.jclouds.profitbricks.rest.domain.Volume;
> +import org.apache.jclouds.profitbricks.rest.domain.options.DepthOptions;
> +import 
> org.apache.jclouds.profitbricks.rest.internal.BaseProfitBricksApiMockTest;
> +import static org.testng.Assert.assertEquals;
> +import static org.testng.Assert.assertNotNull;
> +import static org.testng.Assert.assertTrue;
> +import org.testng.annotations.Test;
> +
> +@Test(groups = "unit", testName = "VolumeApiMockTest", singleThreaded = true)

Hmm. Do you need this test to be `singleThreaded`?

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

Re: [jclouds-labs] Profitbricks REST - Volume API (#233)

2016-02-10 Thread Reijhanniel Jearl Campos
> @@ -89,13 +89,13 @@ protected MockResponse response204() {
> protected MockResponse response404() {

No need for this then. :) Also, remove 404 tests (or Unauthorized, if exists) 
from other tests, if possible.

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

Re: [jclouds-labs] Profitbricks REST - Volume API (#233)

2016-02-10 Thread Reijhanniel Jearl Campos
> +  assertSent(server, "PATCH", 
> "/rest/datacenters/datacenter-id/volumes/some-id", "{\"name\": 
> \"apache-volume\"}");
> +   }
> +   
> +   @Test
> +   public void testDelete() throws InterruptedException {
> +  server.enqueue(
> + new MockResponse().setBody("")
> +  );
> +  
> +  volumeApi().deleteVolume("datacenter-id", "some-id");
> +  assertEquals(server.getRequestCount(), 1);
> +  assertSent(server, "DELETE", 
> "/datacenters/datacenter-id/volumes/some-id");
> +   }
> +   
> +   @Test
> +   public void testDeleteWith404() throws InterruptedException {

Same as above

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

Re: [jclouds-labs] Profitbricks REST - Volume API (#233)

2016-02-10 Thread Reijhanniel Jearl Campos
> + * Unless required by applicable law or agreed to in writing, software
> + * distributed under the License is distributed on an "AS IS" BASIS,
> + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
> + * See the License for the specific language governing permissions and
> + * limitations under the License.
> + */
> +package org.apache.jclouds.profitbricks.rest.util;
> +
> +import java.util.regex.Pattern;
> +
> +public class MacAddresses {
> +
> +   private static final String MAC_ADDR_FORMAT = 
> "^([0-9a-f]{2}[:]){5}([0-9a-f]{2})$";
> +   private static final Pattern MAC_ADDR_PATTERN = 
> Pattern.compile(MAC_ADDR_FORMAT);
> +
> +   public static boolean isMacAddress(String in) {

Add missing test

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

Re: [jclouds-labs] Profitbricks REST - Volume API (#233)

2016-02-10 Thread Reijhanniel Jearl Campos
> + * http://www.apache.org/licenses/LICENSE-2.0
> + *
> + * Unless required by applicable law or agreed to in writing, software
> + * distributed under the License is distributed on an "AS IS" BASIS,
> + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
> + * See the License for the specific language governing permissions and
> + * limitations under the License.
> + */
> +package org.apache.jclouds.profitbricks.rest.util;
> +
> +import java.util.Random;
> +import java.util.regex.Pattern;
> +
> +import com.google.common.collect.ImmutableSet;
> +
> +public class Passwords {

Add test for this too, so we can validate it's 
[usage](https://github.com/jclouds/jclouds-labs/pull/233/files#diff-6d0cd6b1064677eca969d404ba5c0a91R175).

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

Re: [jclouds-labs] Profitbricks REST - Volume API (#233)

2016-02-10 Thread Reijhanniel Jearl Campos
> +   @MapBinder(UpdateVolumeRequestBinder.class)
> +   @ResponseParser(VolumeApi.VolumeParser.class)
> +   @Produces("application/vnd.profitbricks.partial-properties+json")
> +   Volume updateVolume(@PayloadParam("volume") Volume.Request.UpdatePayload 
> payload);
> +   
> +   @Named("volume:delete")
> +   @DELETE
> +   @Path("/{volumeId}")
> +   @Fallback(Fallbacks.VoidOnNotFoundOr404.class)
> +   void deleteVolume(@PathParam("dataCenterId") String dataCenterId, 
> @PathParam("volumeId") String volumeId);
> +   
> +   @Named("volume:snapshot:create")
> +   @POST
> +   @MapBinder(CreateSnapshotRequestBinder.class)
> +   @ResponseParser(SnapshotApi.SnapshotParser.class)
> +   Snapshot createSnapshot(@PayloadParam("snapshot") 
> Volume.Request.CreateSnapshotPayload payload);

Hmm. Should this (and `restoreSnapshot`) be in `SnapshotApi.java` instead? If 
so, don't forget to move both of their 
[tests](https://github.com/jclouds/jclouds-labs/pull/233/files#diff-81aadea0059ec0e66cf6304f6234762bR148)
 too!

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

Re: [jclouds-labs] Profitbricks REST - Volume API (#233)

2016-02-10 Thread Reijhanniel Jearl Campos
Hi @mirza-spc !

Did initial review for the PR, while waiting for others to jump in. :) In 
addition to the comments above, could you add a test for 
[`ParseId`](https://github.com/StackPointCloud/jclouds-labs/commit/60869d038e8022165b6b1c32cb80233cee213033#diff-640a66e9fc832b6c994d936877e933caR29)?
 This way, we're confident that the `#parseId` method actually returns what we 
expect. And, can you move the 
[`Pattern.compile(..)`](https://github.com/StackPointCloud/jclouds-labs/commit/60869d038e8022165b6b1c32cb80233cee213033#diff-640a66e9fc832b6c994d936877e933caR43)
 as a class level 
[property](https://github.com/StackPointCloud/jclouds-labs/commit/60869d038e8022165b6b1c32cb80233cee213033#diff-640a66e9fc832b6c994d936877e933caR32),
 so that the pattern is only compiled once (and not everytime the method is 
called).

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

Re: [jclouds-labs-openstack] JCLOUDS-691: Remove 404 fallbacks of PUT and POST calls from OpenStac… (#201)

2016-02-05 Thread Reijhanniel Jearl Campos
Pushed to master as 
[`167312f`](https://github.com/jclouds/jclouds-labs-openstack/commit/167312fb41997b9add33e409f542fc4a4dcd22cd).
 Thanks for the reviews!

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/201#issuecomment-180638999

Re: [jclouds-labs-openstack] JCLOUDS-691: Remove 404 fallbacks of PUT and POST calls from OpenStac… (#201)

2016-02-05 Thread Reijhanniel Jearl Campos
Closed #201.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/201#event-541479099

Re: [jclouds-labs-openstack] JCLOUDS-691: Remove 404 fallbacks of PUT and POST calls from OpenStac… (#201)

2016-02-04 Thread Reijhanniel Jearl Campos
Amended commit. I accidentally deleted `NetworkApiMockTest`, 
`SecurityGroupApiMockTest`, `RouterApiMockTest` and `PortApiMockTest` in the 
previous commit.

Also reverted removal of fallback in 
[`removeInterfaceForPort`](https://github.com/jclouds/jclouds-labs-openstack/pull/201/files#diff-d3f1d01449178596e90b101c56063c7bR193)
 (and `*subnet`), despite being `@PUT` operations for it seems like they're 
actually *delete* operations.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/201#issuecomment-180136953

[jclouds-labs-openstack] JCLOUDS-691: Remove 404 fallbacks of PUT and POST calls from OpenStac… (#201)

2016-02-04 Thread Reijhanniel Jearl Campos
…k APIs

Removed unneeded tests as well from glance, heat, neutron, poppy, marconi.
You can view, comment on, or merge this pull request online at:

  https://github.com/jclouds/jclouds-labs-openstack/pull/201

-- Commit Summary --

  * JCLOUDS-691: Remove 404 fallbacks of PUT and POST calls from OpenStack APIs

-- File Changes --

M 
openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/features/ImageApiExpectTest.java
 (175)
M 
openstack-heat/src/test/java/org/jclouds/openstack/heat/v1/features/ResourceApiMockTest.java
 (26)
M 
openstack-heat/src/test/java/org/jclouds/openstack/heat/v1/features/StackApiMockTest.java
 (202)
M 
openstack-heat/src/test/java/org/jclouds/openstack/heat/v1/features/TemplateApiMockTest.java
 (40)
M 
openstack-marconi/src/main/java/org/jclouds/openstack/marconi/v1/features/ClaimApi.java
 (5)
M 
openstack-marconi/src/main/java/org/jclouds/openstack/marconi/v1/features/MessageApi.java
 (2)
M 
openstack-marconi/src/main/java/org/jclouds/openstack/marconi/v1/features/QueueApi.java
 (6)
M 
openstack-marconi/src/test/java/org/jclouds/openstack/marconi/v1/features/ClaimApiLiveTest.java
 (9)
M 
openstack-marconi/src/test/java/org/jclouds/openstack/marconi/v1/features/ClaimApiMockTest.java
 (4)
M 
openstack-marconi/src/test/java/org/jclouds/openstack/marconi/v1/features/MessageApiLiveTest.java
 (4)
M 
openstack-marconi/src/test/java/org/jclouds/openstack/marconi/v1/features/QueueApiLiveTest.java
 (12)
M 
openstack-marconi/src/test/java/org/jclouds/openstack/marconi/v1/features/QueueApiMockTest.java
 (68)
M 
openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/extensions/FWaaSApi.java
 (7)
M 
openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/extensions/FloatingIPApi.java
 (2)
M 
openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/extensions/RouterApi.java
 (12)
M 
openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/extensions/lbaas/v1/LBaaSApi.java
 (8)
M 
openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/features/NetworkApi.java
 (2)
M 
openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/features/PortApi.java
 (1)
M 
openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/features/SubnetApi.java
 (1)
M 
openstack-neutron/src/test/java/org/jclouds/openstack/neutron/v2/extensions/FWaaSApiMockTest.java
 (418)
M 
openstack-neutron/src/test/java/org/jclouds/openstack/neutron/v2/extensions/FloatingIPApiMockTest.java
 (179)
M 
openstack-neutron/src/test/java/org/jclouds/openstack/neutron/v2/extensions/RouterApiLiveTest.java
 (8)
D 
openstack-neutron/src/test/java/org/jclouds/openstack/neutron/v2/extensions/RouterApiMockTest.java
 (690)
D 
openstack-neutron/src/test/java/org/jclouds/openstack/neutron/v2/extensions/SecurityGroupApiMockTest.java
 (711)
M 
openstack-neutron/src/test/java/org/jclouds/openstack/neutron/v2/extensions/lbaas/v1/LBaaSApiMockTest.java
 (742)
M 
openstack-neutron/src/test/java/org/jclouds/openstack/neutron/v2/features/ExtensionApiMockTest.java
 (56)
D 
openstack-neutron/src/test/java/org/jclouds/openstack/neutron/v2/features/NetworkApiMockTest.java
 (464)
D 
openstack-neutron/src/test/java/org/jclouds/openstack/neutron/v2/features/PortApiMockTest.java
 (493)
M 
openstack-neutron/src/test/java/org/jclouds/openstack/neutron/v2/features/SubnetApiMockTest.java
 (189)
M 
openstack-poppy/src/main/java/org/jclouds/openstack/poppy/v1/features/ServiceApi.java
 (2)
M 
openstack-poppy/src/test/java/org/jclouds/openstack/poppy/v1/features/ServiceApiMockTest.java
 (144)

-- Patch Links --

https://github.com/jclouds/jclouds-labs-openstack/pull/201.patch
https://github.com/jclouds/jclouds-labs-openstack/pull/201.diff

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


Re: [jclouds] JCLOUDS-691: Remove 404 fallbacks of PUT and POST calls from OpenStac… (#911)

2016-02-02 Thread Reijhanniel Jearl Campos
Just to be clear, does this mean that tests like 
[this](https://github.com/jclouds/jclouds/pull/911/files#diff-346bc00a46231f33755b2d3ec420cfbbR129)
 are no longer needed? Since the `ResourceNotFoundException` is a Fallback in 
the jclouds-core?

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

[jclouds] JCLOUDS-691: Remove 404 fallbacks of PUT and POST calls from OpenStac… (#911)

2016-01-31 Thread Reijhanniel Jearl Campos
…k Apis

openstack cinder, keystone, nova, nova-ec2, swift, trove
You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * JCLOUDS-691: Remove 404 fallbacks of PUT and POST calls from OpenStack Apis

-- File Changes --

M 
apis/openstack-keystone/src/main/java/org/jclouds/openstack/keystone/v2_0/extensions/RoleAdminApi.java
 (1)
M 
apis/openstack-keystone/src/main/java/org/jclouds/openstack/keystone/v2_0/extensions/ServiceAdminApi.java
 (1)
M 
apis/openstack-keystone/src/main/java/org/jclouds/openstack/keystone/v2_0/extensions/TenantAdminApi.java
 (9)
M 
apis/openstack-keystone/src/main/java/org/jclouds/openstack/keystone/v2_0/extensions/UserAdminApi.java
 (4)
M 
apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/extensions/RoleAdminApiMockTest.java
 (9)
M 
apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/extensions/ServiceAdminApiMockTest.java
 (10)
M 
apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/extensions/TenantAdminApiMockTest.java
 (27)
M 
apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/extensions/UserAdminApiMockTest.java
 (19)
M 
apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/FlavorExtraSpecsApi.java
 (24)
M 
apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/FloatingIPApi.java
 (6)
M 
apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/SecurityGroupApi.java
 (3)
M 
apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/ServerAdminApi.java
 (31)
M 
apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/VolumeTypeApi.java
 (6)
M 
apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/FlavorApi.java
 (2)
M 
apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/ImageApi.java
 (7)
M 
apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/ServerApi.java
 (2)
M 
apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/AdminActionsApiExpectTest.java
 (52)
M 
apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/AdminActionsApiLiveTest.java
 (24)
M 
apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/FlavorExtraSpecsApiExpectTest.java
 (4)
M 
apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/FlavorExtraSpecsApiLiveTest.java
 (4)
M 
apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/VolumeTypeApiExpectTest.java
 (4)
M 
apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/VolumeTypeApiLiveTest.java
 (4)
M 
apis/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/blobstore/RegionScopedSwiftBlobStore.java
 (5)
M 
apis/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/features/AccountApi.java
 (12)
M 
apis/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/features/ContainerApi.java
 (12)
M 
apis/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/features/ObjectApi.java
 (28)
M 
apis/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/features/AccountApiLiveTest.java
 (4)
M 
apis/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/features/AccountApiMockTest.java
 (4)
M 
apis/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/features/ContainerApiLiveTest.java
 (8)
M 
apis/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/features/ContainerApiMockTest.java
 (2)
M 
apis/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/features/ObjectApiLiveTest.java
 (14)
M 
apis/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/features/ObjectApiMockTest.java
 (17)
M 
apis/openstack-trove/src/main/java/org/jclouds/openstack/trove/v1/features/DatabaseApi.java
 (6)
M 
apis/openstack-trove/src/main/java/org/jclouds/openstack/trove/v1/features/InstanceApi.java
 (1)
M 
apis/openstack-trove/src/main/java/org/jclouds/openstack/trove/v1/features/UserApi.java
 (15)
M 
apis/openstack-trove/src/test/java/org/jclouds/openstack/trove/v1/features/DatabaseApiExpectTest.java
 (17)
M 
apis/openstack-trove/src/test/java/org/jclouds/openstack/trove/v1/features/DatabaseApiLiveTest.java
 (2)
M 
apis/openstack-trove/src/test/java/org/jclouds/openstack/trove/v1/features/InstanceApiExpectTest.java
 (7)
M 
apis/openstack-trove/src/test/java/org/jclouds/openstack/trove/v1/features/UserApiExpectTest.java
 (36)

-- Patch Links --

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

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


Re: [jclouds-labs] Profitbricks server api (#227)

2016-01-28 Thread Reijhanniel Jearl Campos
> + * Unless required by applicable law or agreed to in writing, software
> + * distributed under the License is distributed on an "AS IS" BASIS,
> + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
> + * See the License for the specific language governing permissions and
> + * limitations under the License.
> + */
> +package org.apache.jclouds.profitbricks.rest.domain;
> +
> +import java.util.Date;
> +
> +import com.google.auto.value.AutoValue;
> +
> +import org.jclouds.javax.annotation.Nullable;
> +
> +@AutoValue
> +public abstract class Snapshot {

In relation to this 
[comment](https://github.com/jclouds/jclouds-labs/pull/227#issuecomment-172589850),
 it seems you can remove this Domain class, at least for this PR. I'd 
understand the inclusion of Volume and Nic, since they're returned by the API, 
based on [docs](https://devops.profitbricks.com/api/rest/#retrieve-a-server).

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

Re: [jclouds-labs] Profitbricks server api (#227)

2016-01-28 Thread Reijhanniel Jearl Campos
> + * (the "License"); you may not use this file except in compliance with
> + * the License.  You may obtain a copy of the License at
> + *
> + * http://www.apache.org/licenses/LICENSE-2.0
> + *
> + * Unless required by applicable law or agreed to in writing, software
> + * distributed under the License is distributed on an "AS IS" BASIS,
> + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
> + * See the License for the specific language governing permissions and
> + * limitations under the License.
> + */
> +package org.apache.jclouds.profitbricks.rest.util;
> +
> +import java.util.regex.Pattern;
> +
> +public class MacAddresses {

Remove this class for this PR, since it's not used.

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

Re: [jclouds-labs] Profitbricks server api (#227)

2016-01-28 Thread Reijhanniel Jearl Campos
> +   @POST
> +   @Path("/{serverId}/stop")
> +   void stopServer(@PathParam("dataCenterId") String dataCenterId, 
> @PathParam("serverId") String serverId);
> +   
> +   static final class ServerParser extends ParseJson {
> +  @Inject ServerParser(Json json) {
> + super(json, TypeLiteral.get(Server.class));
> +  }
> +
> +  @Override
> +  public  V apply(InputStream stream, Type type) throws IOException {
> + String data = Strings2.toStringAndClose(stream);
> + 
> + Gson gson = new Gson();
> + Type mapType = new TypeToken>(){}.getType();
> + Map jsonMap = gson.fromJson(data, mapType);

Does 
```
Map jsonMap = json.fromJson( data, mapType );
```
work here? If so, you may remove the use of `Gson` here

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

Re: [jclouds-labs] Profitbricks server api (#227)

2016-01-28 Thread Reijhanniel Jearl Campos
> + * http://www.apache.org/licenses/LICENSE-2.0
> + *
> + * Unless required by applicable law or agreed to in writing, software
> + * distributed under the License is distributed on an "AS IS" BASIS,
> + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
> + * See the License for the specific language governing permissions and
> + * limitations under the License.
> + */
> +package org.apache.jclouds.profitbricks.rest.util;
> +
> +import java.util.Random;
> +import java.util.regex.Pattern;
> +
> +import com.google.common.collect.ImmutableSet;
> +
> +public class Passwords {

Same for this class

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

Re: [jclouds-labs] Profitbricks server api (#227)

2016-01-28 Thread Reijhanniel Jearl Campos
Hi @mirza-spc ! Jumping in while this is in wait for further review. 

About the direct use of Gson in the 
[RequestBinder](https://github.com/jclouds/jclouds-labs/pull/227/files#diff-5f15aace37e6097c7e68751cd0aae853R45):
 I was looking at other JSON-returning APIs from other providers, I noticed 
that the common pattern was to inject 
[`Json`](https://github.com/jclouds/jclouds/blob/master/core/src/main/java/org/jclouds/json/Json.java),
 and use that to do the conversion. Here's an example from 
[docker](https://github.com/jclouds/jclouds-labs/blob/master/docker/src/main/java/org/jclouds/docker/features/ContainerApi.java#L80)
 which directly uses 
[`BindToJsonPayload`](https://github.com/jclouds/jclouds/blob/master/core/src/main/java/org/jclouds/rest/binders/BindToJsonPayload.java#L32),
 and for DigitalOcean2's 
[createDroplet](https://github.com/jclouds/jclouds/blob/master/providers/digitalocean2/src/main/java/org/jclouds/digitalocean2/features/DropletApi.java#L284),
 with a custom 
[binder](https://github.com/jclouds/jclouds/blob/master/providers/digitalocean2/s
 
rc/main/java/org/jclouds/digitalocean2/domain/options/CreateDropletOptions.java#L38).

Also, don't squash the commits yet! Address succeeding comments, with a 
separate commit on top of now 
[`6b2da43`](https://github.com/StackPointCloud/jclouds-labs/commit/6b2da43b2d343bbb9c123cdc2538a0bf6fb5a8e6).
 This way, it's easier for reviewers to see the changes only of the addressing 
commit. :)

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

Re: [jclouds-labs] Profitbricks server api (#227)

2016-01-28 Thread Reijhanniel Jearl Campos
> +   @Path("/{serverId}/volumes/{volumeId}")
> +   @Fallback(Fallbacks.NullOnNotFoundOr404.class)
> +   @ResponseParser(VolumeApi.VolumeParser.class)
> +   Volume getVolume(@PathParam("dataCenterId") String dataCenterId, 
> @PathParam("serverId") String serverId, @PathParam("volumeId") String 
> volumeId);
> +   
> +   @Named("server:cdrom:list")
> +   @GET
> +   @Path("/{serverId}/cdroms")
> +   @Fallback(EmptyListOnNotFoundOr404.class)
> +   @SelectJson("items")
> +   List listAttachedCdroms(@PathParam("dataCenterId") String 
> dataCenterId, @PathParam("serverId") String serverId);
> +   
> +   @Named("server:cdrom:attach")
> +   @POST
> +   @MapBinder(AttachCdromRequestBinder.class)
> +   @Fallback(Fallbacks.NullOnNotFoundOr404.class)

Remove fallback

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

Re: [jclouds-labs] Profitbricks server api (#227)

2016-01-28 Thread Reijhanniel Jearl Campos
> +   void stopServer(@PathParam("dataCenterId") String dataCenterId, 
> @PathParam("serverId") String serverId);
> +   
> +   static final class ServerParser extends ParseJson {
> +  @Inject ServerParser(Json json) {
> + super(json, TypeLiteral.get(Server.class));
> +  }
> +
> +  @Override
> +  public  V apply(InputStream stream, Type type) throws IOException {
> + String data = Strings2.toStringAndClose(stream);
> + 
> + Gson gson = new Gson();
> + Type mapType = new TypeToken>(){}.getType();
> + Map jsonMap = gson.fromJson(data, mapType);
> + 
> + Pattern p = Pattern.compile(".*/datacenters/(.*)/servers.*");

Maybe move this as a constant above? So that the pattern is compiled only once, 
and not on every method call.

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

Re: [jclouds-labs] Profitbricks server api (#227)

2016-01-28 Thread Reijhanniel Jearl Campos
> +   @DELETE
> +   @Path("/{serverId}")
> +   @Fallback(Fallbacks.VoidOnNotFoundOr404.class)
> +   void deleteServer(@PathParam("dataCenterId") String dataCenterId, 
> @PathParam("serverId") String serverId);
> +   
> +   @Named("server:volume:list")
> +   @GET
> +   @Path("/{serverId}/volumes")
> +   @Fallback(EmptyListOnNotFoundOr404.class)
> +   @SelectJson("items")
> +   List listAttachedVolumes(@PathParam("dataCenterId") String 
> dataCenterId, @PathParam("serverId") String serverId);
> +   
> +   @Named("server:volume:attach")
> +   @POST
> +   @Path("/{serverId}/volumes")
> +   @Fallback(Fallbacks.NullOnNotFoundOr404.class)

Remove 404 fallback for POST/PUT APIs. 
([discussion](https://github.com/jclouds/jclouds-labs-openstack/pull/135/files#r16700137))

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

Re: [jclouds-labs] Profitbricks server api (#227)

2016-01-27 Thread Reijhanniel Jearl Campos
Hi! I tried to build this branch on my machine, although it throws a 
compilation error on Azure (might be because of updates from the jclouds core).

With jenkins build aside, it seems to be 
[failing](https://jclouds.ci.cloudbees.com/job/jclouds-labs-pull-requests/1003/org.apache.jclouds.labs$profitbricks-rest/console)
 because of:
```
[INFO] --- maven-checkstyle-plugin:2.15:check (default) @ profitbricks-rest ---
[WARNING] 
src/main/java/org/apache/jclouds/profitbricks/rest/ProfitBricksApiMetadata.java[27:15]
 (imports) UnusedImports: Unused import - 
org.jclouds.reflect.Reflection2.typeToken.
```
This "style check" complain is reproducible as well when running:
```
mvn checkstyle:checkstyle --quiet -Dcheckstyle.output.file=/dev/stdout 
-Dcheckstyle.output.format=plain
```
Let's see if this makes jenkins happy. :)

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

Re: [jclouds-karaf] 1056: Added ProfitBricks (#74)

2016-01-26 Thread Reijhanniel Jearl Campos
+1

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

Re: [jclouds-cli] JCLOUDS-1056: Added ProfitBricks (#30)

2016-01-26 Thread Reijhanniel Jearl Campos
Ok! Will post results in a while

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

Re: [jclouds] JCLOUDS-1053: Fallback to -1 when sshj exit status returns null (#900)

2016-01-21 Thread Reijhanniel Jearl Campos
Added mock test. Also, updated `ssh_test.clj` for it seemed like clojure always 
casts "numbers" to `long`. Throws this exception without the explicit cast:
```
1) ClassCastException on node 9:
java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer
at org.jclouds.ssh_test.NoOpClient.exec(ssh_test.clj:63)
at 
org.jclouds.compute.callables.RunScriptOnNodeUsingSsh.runCommand(RunScriptOnNodeUsingSsh.java:107)
at 
org.jclouds.compute.callables.RunScriptOnNodeUsingSsh.call(RunScriptOnNodeUsingSsh.java:80)
...omitted..
```

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

[jclouds] JCLOUDS-1053: Fallback to -1 when sshj exit status returns null (#900)

2016-01-19 Thread Reijhanniel Jearl Campos
[JIRA Ticket](https://issues.apache.org/jira/browse/JCLOUDS-1053).

Change: Returns -1, in case the sshj driver returns a null exit status.
You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * JCLOUDS-1053: Fallback to -1 when sshj exit status returns null

-- File Changes --

M drivers/sshj/src/main/java/org/jclouds/sshj/SshjSshClient.java (2)

-- Patch Links --

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

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


[jclouds-labs] JCLOUDS-690: Remove 404 fallbacks of PUT and POST calls from CloudSig… (#229)

2016-01-19 Thread Reijhanniel Jearl Campos
…ma2Api
You can view, comment on, or merge this pull request online at:

  https://github.com/jclouds/jclouds-labs/pull/229

-- Commit Summary --

  * JCLOUDS-690: Remove 404 fallbacks of PUT and POST calls from CloudSigma2Api

-- File Changes --

M cloudsigma2/src/main/java/org/jclouds/cloudsigma2/CloudSigma2Api.java (17)

-- Patch Links --

https://github.com/jclouds/jclouds-labs/pull/229.patch
https://github.com/jclouds/jclouds-labs/pull/229.diff

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


Re: [jclouds-labs] JCLOUDS-1047: Fix ProfitBricks compute service live tests (#224)

2016-01-19 Thread Reijhanniel Jearl Campos
Updated to fix compilation errors in 
[`ProfitBricksTemplateBuilderImpl`](https://github.com/jclouds/jclouds-labs/pull/224/files#diff-1500f3a9004863afdd8a7869407b390aR49)
 due to change in core

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

Re: [jclouds-labs] JCLOUDS-1047: Fix ProfitBricks compute service live tests (#224)

2016-01-18 Thread Reijhanniel Jearl Campos
Ran the test using your provided 
[snippet](https://github.com/devcsrj/bug-reports/blob/master/jclouds-1047/src/main/java/io/devcsrj/report/jclouds/RunScriptUsingBasicLogin.java#L107),
 and it produced the same exception:

```
Creating test datacenter
Building template
Bootstrapping node
Testing future.cancel()
Deleting test datacenter
Exception in thread "main" org.jclouds.rest.AuthorizationException: 
(root:pw[97db1846570837fce6ff62a408f1d26a]@00.00.00.00:22) 
(root:pw[97db1846570837fce6ff62a408f1d26a]@00.00.00.00:22) error acquiring 
{hostAndPort=00.00.00.00:22, loginUser=root, ssh=1533657934, 
connectTimeout=6, sessionTimeout=6} (out of retries - max 7): Exhausted 
available authentication methods
at org.jclouds.sshj.SshjSshClient.propagate(SshjSshClient.java:395)
at org.jclouds.sshj.SshjSshClient.acquire(SshjSshClient.java:205)
at org.jclouds.sshj.SshjSshClient.connect(SshjSshClient.java:225)
at 
org.jclouds.compute.callables.SudoAwareInitManager.refreshAndRunAction(SudoAwareInitManager.java:74)
at 
org.jclouds.compute.callables.BlockUntilInitScriptStatusIsZeroThenReturnOutput.interruptTask(BlockUntilInitScriptStatusIsZeroThenReturnOutput.java:159)
at 
com.google.common.util.concurrent.AbstractFuture.cancel(AbstractFuture.java:136)
at 
io.devcsrj.report.jclouds.RunScriptUsingBasicLogin.testWeCanCancelTask(RunScriptUsingBasicLogin.java:107)
at 
io.devcsrj.report.jclouds.RunScriptUsingBasicLogin.main(RunScriptUsingBasicLogin.java:92)
Caused by: net.schmizz.sshj.userauth.UserAuthException: Exhausted available 
authentication methods
at net.schmizz.sshj.SSHClient.auth(SSHClient.java:217)
at net.schmizz.sshj.SSHClient.auth(SSHClient.java:193)
at net.schmizz.sshj.SSHClient.authPassword(SSHClient.java:278)
at net.schmizz.sshj.SSHClient.authPassword(SSHClient.java:248)
at net.schmizz.sshj.SSHClient.authPassword(SSHClient.java:232)
at 
org.jclouds.sshj.SSHClientConnection.create(SSHClientConnection.java:165)
at 
org.jclouds.sshj.SSHClientConnection.create(SSHClientConnection.java:49)
at org.jclouds.sshj.SshjSshClient.acquire(SshjSshClient.java:195)
... 6 more
Caused by: net.schmizz.sshj.userauth.UserAuthException: Timeout expired
at 
net.schmizz.sshj.userauth.UserAuthException$1.chain(UserAuthException.java:33)
at 
net.schmizz.sshj.userauth.UserAuthException$1.chain(UserAuthException.java:26)
at net.schmizz.concurrent.Promise.retrieve(Promise.java:139)
at 
net.schmizz.sshj.userauth.UserAuthImpl.authenticate(UserAuthImpl.java:69)
at net.schmizz.sshj.SSHClient.auth(SSHClient.java:211)
... 13 more
Caused by: java.util.concurrent.TimeoutException: Timeout expired
... 16 more
```

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

Re: [jclouds-labs] JCLOUDS-1047: Fix ProfitBricks compute service live tests (#224)

2015-12-18 Thread Reijhanniel Jearl Campos
So I've created two minimal `main` files to run the offending test:
1. 
[RunScriptUsingBasicLogin](https://github.com/devcsrj/bug-reports/blob/master/jclouds-1047/src/main/java/io/devcsrj/report/jclouds/RunScriptUsingBasicLogin.java#L97)
 - attempts to cancel using the default identity+credentials.
2. 
[RunScriptUsingPrivateKey](https://github.com/devcsrj/bug-reports/blob/master/jclouds-1047/src/main/java/io/devcsrj/report/jclouds/RunScriptUsingPrivateKey.java#L97)
 - attempts to cancel after overriding with user `foo`, then using it plus 
private key.

Both files reproduce the issue. BUT
> ..the weirdest part of this last test, is that, sometimes, it passes.

I can now reproduce the *weirdest part*. When debugging any of the two, adding 
a breakpoint to [`ssh.connect()`]( 
https://github.com/jclouds/jclouds/blob/master/compute/src/main/java/org/jclouds/compute/callables/SudoAwareInitManager.java#L74),
 then stepping to `return runAction(action);` will succeed, in contrast to the 
[original 
exception](https://gist.github.com/devcsrj/9675b0c3bb04a133fb50/1211b7546f9b17b5d4edaab578092b2b45fb44ac#file-jclouds-profitbricks-live-tests-log-L321).
 Without doing this, the connection would fail. 

I wonder if this has something to do with the delay I present before stepping 
through that, or maybe synchronization issues? Continuing investigation.

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

Re: [jclouds-labs] JCLOUDS-1047: Fix ProfitBricks compute service live tests (#224)

2015-12-16 Thread Reijhanniel Jearl Campos
> Regarding the Jetty test... Is it possible that the IP addresses that are 
> being added to the node are not reachable?

You were right. It turns out, it was our own network's firewall that blocks my 
machine's request to the remote node's public IP. (This explains as well as to 
why this test passes when I run this at home. *sigh* -.-)

> Failed test: weCanCancelTasks method from 
> testAScriptExecutionAfterBootWithBasicTemplate:262 

To debug this: I logged in to the node before the tests [executes 
scripts](https://github.com/jclouds/jclouds/blob/master/compute/src/test/java/org/jclouds/compute/internal/BaseComputeServiceLiveTest.java#L229).
 After the test [adds a 
user](https://github.com/jclouds/jclouds/blob/master/compute/src/test/java/org/jclouds/compute/internal/BaseComputeServiceLiveTest.java#L253),
 I have confirmed that a user `foo` was added, along with it's home directory 
`/over/ridden/foo`. The test afterwards asserts that the `LoginCredentials` 
should've been 
[changed](https://github.com/jclouds/jclouds/blob/master/compute/src/test/java/org/jclouds/compute/internal/BaseComputeServiceLiveTest.java#L259)
 - which it does; from previously 
> `identity=root,password=`

 to 
> `identity=foo,privateKey=`. 

I verified `foo`'s 
[`authorized_keys`](https://github.com/jclouds/jclouds/blob/master/compute/src/test/resources/runscript_adminUpdate.sh#L99)
 in the remote node, and my private key is there. Finally, it fails when the 
`ListenableFuture` is 
[cancelled](https://github.com/jclouds/jclouds/blob/master/compute/src/test/java/org/jclouds/compute/internal/BaseComputeServiceLiveTest.java#L305).

I stopped the test before it 
[destroyed](https://github.com/jclouds/jclouds/blob/master/compute/src/test/java/org/jclouds/compute/internal/BaseComputeServiceLiveTest.java#L271)
 the node, and tried to login to the node with `ssh foo@ip`. It worked.

Now, the weirdest part of this last test, is that, sometimes, it *passes*. **It 
passes**. This usually, but not consistently, happens when I walk through 
line-by-line with the debugger.

Stumped. Thoughts?

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

Re: [jclouds-labs] JCLOUDS-1047: Fix ProfitBricks compute service live tests (#224)

2015-12-14 Thread Reijhanniel Jearl Campos
Hi @nacx !

I'm stuck with one last live test, failing in the 
[`weCanCancelTasks`](https://github.com/jclouds/jclouds/blob/master/compute/src/test/java/org/jclouds/compute/internal/BaseComputeServiceLiveTest.java#L305)
 method from 
[`testAScriptExecutionAfterBootWithBasicTemplate:262`](https://gist.github.com/devcsrj/9675b0c3bb04a133fb50/1211b7546f9b17b5d4edaab578092b2b45fb44ac#file-jclouds-profitbricks-live-tests-log-L332).
 Any insight/similar issue/ideas or clue where to start investigating this?

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

Re: [jclouds-labs] JCLOUDS-1047: Fix ProfitBricks compute service live tests (#224)

2015-12-14 Thread Reijhanniel Jearl Campos
[Live 
tests](https://gist.github.com/devcsrj/9675b0c3bb04a133fb50/1211b7546f9b17b5d4edaab578092b2b45fb44ac)
`
Tests run: 92, Failures: 1, Errors: 0, Skipped: 12`

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

[jclouds-labs] JCLOUDS-1047: Fix ProfitBricks compute service live tests (#224)

2015-12-10 Thread Reijhanniel Jearl Campos
(wip):

Ran with:
```
mvn clean install -Plive -Dtest.profitbricks.identity= 
-Dtest.profitbricks.credential='' 
-Dtest.profitbricks.template="imageId=,loginUser=:"
```
You can view, comment on, or merge this pull request online at:

  https://github.com/jclouds/jclouds-labs/pull/224

-- Commit Summary --

  * JCLOUDS-1047: Fix ProfitBricks compute service live tests

-- File Changes --

M 
profitbricks/src/main/java/org/jclouds/profitbricks/ProfitBricksProviderMetadata.java
 (9)
M 
profitbricks/src/main/java/org/jclouds/profitbricks/compute/ProfitBricksComputeServiceAdapter.java
 (29)
A 
profitbricks/src/main/java/org/jclouds/profitbricks/compute/ProfitBricksTemplateBuilderImpl.java
 (101)
M 
profitbricks/src/main/java/org/jclouds/profitbricks/compute/config/ProfitBricksComputeServiceContextModule.java
 (5)
M 
profitbricks/src/main/java/org/jclouds/profitbricks/compute/function/ProvisionableToImage.java
 (31)
M 
profitbricks/src/main/java/org/jclouds/profitbricks/domain/Provisionable.java 
(12)
D 
profitbricks/src/main/java/org/jclouds/profitbricks/domain/internal/FirewallRuleCommonProperties.java
 (44)
D 
profitbricks/src/main/java/org/jclouds/profitbricks/domain/internal/HotPluggable.java
 (102)
D 
profitbricks/src/main/java/org/jclouds/profitbricks/domain/internal/Provisionable.java
 (67)
D 
profitbricks/src/main/java/org/jclouds/profitbricks/domain/internal/ServerCommonProperties.java
 (29)
M 
profitbricks/src/main/java/org/jclouds/profitbricks/http/filters/ProfitBricksSoapMessageEnvelope.java
 (2)
M 
profitbricks/src/test/java/org/jclouds/profitbricks/compute/ProfitBricksComputeServiceLiveTest.java
 (6)
M 
profitbricks/src/test/java/org/jclouds/profitbricks/compute/ProfitBricksTemplateBuilderLiveTest.java
 (68)
M 
profitbricks/src/test/java/org/jclouds/profitbricks/compute/function/ProvisionableToImageTest.java
 (7)
M 
profitbricks/src/test/java/org/jclouds/profitbricks/features/SnapshotApiLiveTest.java
 (19)
M 
profitbricks/src/test/java/org/jclouds/profitbricks/http/filters/ProfitBricksSoapMessageEnvelopeTest.java
 (2)

-- Patch Links --

https://github.com/jclouds/jclouds-labs/pull/224.patch
https://github.com/jclouds/jclouds-labs/pull/224.diff

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


[jira] [Created] (JCLOUDS-1047) Fix ProfitBricks ComputeService live tests

2015-12-08 Thread Reijhanniel Jearl Campos (JIRA)
Reijhanniel Jearl Campos created JCLOUDS-1047:
-

 Summary: Fix ProfitBricks ComputeService live tests
 Key: JCLOUDS-1047
 URL: https://issues.apache.org/jira/browse/JCLOUDS-1047
 Project: jclouds
  Issue Type: Bug
Reporter: Reijhanniel Jearl Campos






--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


Re: [jclouds-labs] JCLOUDS-947: Properly configure live tests in ProfitBricks (#222)

2015-11-13 Thread Reijhanniel Jearl Campos
> the objective of this PR isn't to fix all tests, but to allow us to run all 
> them at once
:+1 That make sense! In that case, objective-wise, this PR is done. 

I'll squash this PR so that you can cleanly merge it. :)

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

[jclouds-labs] JCLOUDS-947: Properly configure live tests in ProfitBricks (#222)

2015-11-11 Thread Reijhanniel Jearl Campos
*WIP*. Creating PR for early comments. Ran live test with:

```sh
➜  profitbricks git:(develop) mvn clean install -Plive 
-Dtest.profitbricks.identity= 
-Dtest.profitbricks.credential= 
-Dtest.profitbricks.template=
```
You can view, comment on, or merge this pull request online at:

  https://github.com/jclouds/jclouds-labs/pull/222

-- Commit Summary --

  * JCLOUDS-947: (WIP) Properly configure live tests in ProfitBricks

-- File Changes --

M 
profitbricks/src/main/java/org/jclouds/profitbricks/binder/loadbalancer/DeregisterLoadBalancerRequestBinder.java
 (4)
M 
profitbricks/src/main/java/org/jclouds/profitbricks/binder/loadbalancer/RegisterLoadBalancerRequestBinder.java
 (6)
M 
profitbricks/src/main/java/org/jclouds/profitbricks/compute/config/ProfitBricksComputeServiceContextModule.java
 (93)
D 
profitbricks/src/main/java/org/jclouds/profitbricks/compute/internal/ProvisioningStatusPollingPredicate.java
 (70)
M 
profitbricks/src/main/java/org/jclouds/profitbricks/config/ProfitBricksComputeProperties.java
 (1)
M profitbricks/src/main/java/org/jclouds/profitbricks/domain/Location.java 
(5)
M 
profitbricks/src/main/java/org/jclouds/profitbricks/features/IpBlockApi.java (5)
M 
profitbricks/src/main/java/org/jclouds/profitbricks/features/LoadBalancerApi.java
 (15)
M profitbricks/src/main/java/org/jclouds/profitbricks/features/NicApi.java 
(16)
A 
profitbricks/src/main/java/org/jclouds/profitbricks/http/parser/loadbalancer/LoadBalancerIdOnlyResponseHandler.java
 (51)
A 
profitbricks/src/main/java/org/jclouds/profitbricks/http/parser/nic/NicIdOnlyResponseHandler.java
 (51)
M 
profitbricks/src/test/java/org/jclouds/profitbricks/BaseProfitBricksLiveTest.java
 (161)
M 
profitbricks/src/test/java/org/jclouds/profitbricks/binder/loadbalancer/DeregisterLoadBalancerRequestBinderTest.java
 (17)
M 
profitbricks/src/test/java/org/jclouds/profitbricks/binder/loadbalancer/RegisterLoadBalancerRequestBinderTest.java
 (18)
R 
profitbricks/src/test/java/org/jclouds/profitbricks/compute/config/StatusPredicateTest.java
 (62)
M 
profitbricks/src/test/java/org/jclouds/profitbricks/features/DataCenterApiLiveTest.java
 (16)
M 
profitbricks/src/test/java/org/jclouds/profitbricks/features/DrivesApiLiveTest.java
 (64)
M 
profitbricks/src/test/java/org/jclouds/profitbricks/features/FirewallApiLiveTest.java
 (110)
M 
profitbricks/src/test/java/org/jclouds/profitbricks/features/ImageApiLiveTest.java
 (30)
M 
profitbricks/src/test/java/org/jclouds/profitbricks/features/IpBlockApiLiveTest.java
 (63)
M 
profitbricks/src/test/java/org/jclouds/profitbricks/features/IpBlockApiMockTest.java
 (4)
M 
profitbricks/src/test/java/org/jclouds/profitbricks/features/LoadBalancerApiLiveTest.java
 (127)
M 
profitbricks/src/test/java/org/jclouds/profitbricks/features/LoadBalancerApiMockTest.java
 (31)
M 
profitbricks/src/test/java/org/jclouds/profitbricks/features/NicApiLiveTest.java
 (104)
M 
profitbricks/src/test/java/org/jclouds/profitbricks/features/NicApiMockTest.java
 (27)
M 
profitbricks/src/test/java/org/jclouds/profitbricks/features/ServerApiLiveTest.java
 (71)
M 
profitbricks/src/test/java/org/jclouds/profitbricks/features/SnapshotApiLiveTest.java
 (133)
M 
profitbricks/src/test/java/org/jclouds/profitbricks/features/StorageApiLiveTest.java
 (65)
A 
profitbricks/src/test/java/org/jclouds/profitbricks/http/parser/loadbalancer/LoadBalancerIdOnlyResponseHandlerTest.java
 (41)
R 
profitbricks/src/test/java/org/jclouds/profitbricks/http/parser/nic/NicIdOnlyResponseHandlerTest.java
 (29)
M profitbricks/src/test/resources/loadbalancer/loadbalancer-create.xml (28)
M profitbricks/src/test/resources/loadbalancer/loadbalancer-deregister.xml 
(26)
M profitbricks/src/test/resources/loadbalancer/loadbalancer-register.xml 
(32)
M profitbricks/src/test/resources/loadbalancer/loadbalancer-update.xml (27)
A profitbricks/src/test/resources/logback-test.xml (74)
M profitbricks/src/test/resources/nic/nic-delete.xml (21)
M profitbricks/src/test/resources/nic/nic-internetaccess.xml (23)
M profitbricks/src/test/resources/nic/nic-update.xml (27)

-- Patch Links --

https://github.com/jclouds/jclouds-labs/pull/222.patch
https://github.com/jclouds/jclouds-labs/pull/222.diff

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


  1   2   >