Skip to content

Commit

Permalink
Fix merge errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jianghaolu committed Sep 13, 2016
1 parent 53ad799 commit 93be0f4
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 80 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

import com.microsoft.azure.CloudException;
import com.microsoft.azure.PagedList;
import com.microsoft.azure.management.compute.VirtualMachineImage;
import com.microsoft.azure.management.compute.VirtualMachineImages;
import com.microsoft.azure.management.compute.VirtualMachineOffer;
import com.microsoft.azure.management.compute.VirtualMachinePublisher;
import com.microsoft.azure.management.compute.VirtualMachinePublishers;
import com.microsoft.azure.management.compute.VirtualMachineImage;
import com.microsoft.azure.management.compute.VirtualMachineImages;
import com.microsoft.azure.management.compute.VirtualMachineSku;
import com.microsoft.azure.management.resources.fluentcore.arm.Region;

import java.io.IOException;

/**
Expand All @@ -35,35 +36,23 @@ public PagedList<VirtualMachineImage> listByRegion(String regionName) throws Clo
new ChildListFlattener<>(publishers, new ChildListFlattener.ChildListLoader<VirtualMachinePublisher, VirtualMachineOffer>() {
@Override
public PagedList<VirtualMachineOffer> loadList(VirtualMachinePublisher publisher) throws CloudException, IOException {
try {
return publisher.offers().list();
} catch (com.microsoft.rest.RestException e) {
e.printStackTrace();
}
return publisher.offers().list();
}
}).flatten();

PagedList<VirtualMachineSku> skus =
new ChildListFlattener<>(offers, new ChildListFlattener.ChildListLoader<VirtualMachineOffer, VirtualMachineSku>() {
@Override
public PagedList<VirtualMachineSku> loadList(VirtualMachineOffer offer) throws CloudException, IOException {
try {
return offer.skus().list();
} catch (com.microsoft.rest.RestException e) {
e.printStackTrace();
}
return offer.skus().list();
}
}).flatten();

PagedList<VirtualMachineImage> images =
new ChildListFlattener<>(skus, new ChildListFlattener.ChildListLoader<VirtualMachineSku, VirtualMachineImage>() {
@Override
public PagedList<VirtualMachineImage> loadList(VirtualMachineSku sku) throws CloudException, IOException {
try {
return sku.images().list();
} catch (com.microsoft.rest.RestException e) {
e.printStackTrace();
}
return sku.images().list();
}
}).flatten();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ protected VirtualMachineOfferImpl wrapModel(VirtualMachineImageResourceInner inn
}

@Override
public PagedList<VirtualMachineOffer> list() throws RestException, IllegalArgumentException, IOException {
public PagedList<VirtualMachineOffer> list() throws CloudException, IllegalArgumentException, IOException {
return wrapList(innerCollection.listOffers(publisher.region().toString(), publisher.name()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@

package com.microsoft.azure.management.redis;

import com.fasterxml.jackson.annotation.JsonValue;

/**
* Defines values for SkuFamily.
*/
public final class SkuFamily {
<<<<<<< 1d9c0c339ddb625c8c18b60f5f1f76db20d3729c:azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/SkuFamily.java
/** Static value C for SkuFamily. */
public static final SkuFamily C = new SkuFamily("C");

Expand All @@ -39,11 +40,20 @@ public String toString() {
public int hashCode() {
return value.hashCode();
}
=======
/** Static value A for SkuFamily. */
public static final String A = "A";
>>>>>>> Basic impl for vault:azure-mgmt-keyvault/src/main/java/com/microsoft/azure/management/keyvault/SkuFamily.java

private SkuFamily() {
@Override
public boolean equals(Object obj) {
if (!(obj instanceof SkuFamily)) {
return false;
}
if (obj == this) {
return true;
}
SkuFamily rhs = (SkuFamily) obj;
if (value == null) {
return rhs.value == null;
} else {
return value.equals(rhs.value);
}
}
}
}
7 changes: 2 additions & 5 deletions azure/src/main/java/com/microsoft/azure/Azure.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
import com.microsoft.azure.management.resources.Tenants;
import com.microsoft.azure.management.resources.fluentcore.arm.AzureConfigurable;
import com.microsoft.azure.management.resources.fluentcore.arm.implementation.AzureConfigurableImpl;
import com.microsoft.azure.management.resources.implementation.ResourceManager;
import com.microsoft.azure.management.resources.implementation.ResourceManagementClientImpl;
import com.microsoft.azure.management.resources.implementation.ResourceManager;
import com.microsoft.azure.management.storage.StorageAccounts;
import com.microsoft.azure.management.storage.Usages;
import com.microsoft.azure.management.storage.implementation.StorageManager;
Expand Down Expand Up @@ -260,10 +260,7 @@ public Azure withDefaultSubscription() throws CloudException, IOException {
if (this.defaultSubscription != null) {
return withSubscription(this.defaultSubscription);
} else {
try {PagedList<Subscription> subs = this.subscriptions().list();
} catch (com.microsoft.rest.RestException e) {
e.printStackTrace();
}
PagedList<Subscription> subs = this.subscriptions().list();
if (!subs.isEmpty()) {
return withSubscription(subs.get(0).subscriptionId());
} else {
Expand Down

This file was deleted.

0 comments on commit 93be0f4

Please sign in to comment.