mirror of https://github.com/apache/jclouds.git
Issue 592:templateBuilder.fromTemplate loses location when more narrow than region
This commit is contained in:
parent
a0692e737f
commit
ac56adc2e1
|
@ -509,6 +509,6 @@ public class EC2TemplateOptions extends TemplateOptions implements Cloneable {
|
|||
@Override
|
||||
public String toString() {
|
||||
return "[groupIds=" + groupIds + ", keyPair=" + keyPair + ", noKeyPair=" + noKeyPair + ", userData="
|
||||
+ Arrays.toString(userData) + ", blockDeviceMappings=" + blockDeviceMappings + "]";
|
||||
+ Arrays.toString(userData) + ", blockDeviceMappings=" + blockDeviceMappings.build() + "]";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -416,6 +416,7 @@ public class TemplateBuilderImpl implements TemplateBuilder {
|
|||
*/
|
||||
@Override
|
||||
public TemplateBuilder fromTemplate(Template template) {
|
||||
location = template.getLocation();
|
||||
fromHardware(template.getHardware());
|
||||
fromImage(template.getImage());
|
||||
options(template.getOptions());
|
||||
|
|
|
@ -101,6 +101,12 @@ public abstract class BaseTemplateBuilderLiveTest {
|
|||
assert getCores(fastest) >= getCores(smallest) : String.format("%s ! >= %s", fastest, smallest);
|
||||
}
|
||||
|
||||
public void testFromTemplate() {
|
||||
Template defaultTemplate = context.getComputeService().templateBuilder().build();
|
||||
assertEquals(context.getComputeService().templateBuilder().fromTemplate(defaultTemplate).build().toString(),
|
||||
defaultTemplate.toString());
|
||||
}
|
||||
|
||||
protected Properties setupProperties() {
|
||||
Properties overrides = new Properties();
|
||||
overrides.setProperty(Constants.PROPERTY_TRUST_ALL_CERTS, "true");
|
||||
|
|
Loading…
Reference in New Issue