Skip to content

Commit

Permalink
Revert "Add compartmentId as a default value for imageCompartmentId"
Browse files Browse the repository at this point in the history
This reverts commit 342ec7d00030b344ca8bbce841dc5a4ec9834c4e
  • Loading branch information
rwx42 committed Oct 10, 2018
1 parent 75d1caa commit 82148f5
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -474,21 +474,21 @@ public ListBoxModel doFillImageCompartmentIdItems(
@QueryParameter @RelativePath("..") String apikey,
@QueryParameter @RelativePath("..") String passphrase,
@QueryParameter @RelativePath("..") String regionId,
@QueryParameter @RelativePath("..") String maxAsyncThreads,
@QueryParameter String compartmentId) throws IOException, ServletException {
@QueryParameter @RelativePath("..") String maxAsyncThreads)
throws IOException, ServletException {
ListBoxModel model = new ListBoxModel();
model.add("<Select image compartmentId>", "compartmentId");
model.add("<Select image compartmentId>", "");

if (anyRequiredFieldEmpty(userId, fingerprint, tenantId, apikey, regionId, compartmentId)) {
if (anyRequiredFieldEmpty(userId, fingerprint, tenantId, apikey, regionId)) {
return model;
}

BaremetalCloudClient client = getClient(fingerprint, apikey, passphrase, tenantId, userId, regionId, maxAsyncThreads);

try{
List<Compartment> compartmentIds = client.getCompartmentsList(tenantId);
for (Compartment compartment : compartmentIds) {
model.add(compartment.getName(), compartment.getId());
for (Compartment compartmentId : compartmentIds) {
model.add(compartmentId.getName(), compartmentId.getId());
}
}catch (Exception e) {
LOGGER.log(Level.WARNING, "Failed to get compartment list", e);
Expand All @@ -505,10 +505,11 @@ public ListBoxModel doFillImageIdItems(
@QueryParameter @RelativePath("..") String passphrase,
@QueryParameter @RelativePath("..") String regionId,
@QueryParameter @RelativePath("..") String maxAsyncThreads,
@QueryParameter String compartmentId,
@QueryParameter String imageCompartmentId) throws IOException, ServletException {
ListBoxModel model = new ListBoxModel();
model.add("<Select an Image>", "");
if (anyRequiredFieldEmpty(userId, fingerprint, tenantId, apikey, regionId, imageCompartmentId)) {
if (anyRequiredFieldEmpty(userId, fingerprint, tenantId, apikey, regionId, compartmentId)) {
return model;
}

Expand Down

0 comments on commit 82148f5

Please sign in to comment.