From 87f1a96c2934fb44b33616729c265af8cd4845be Mon Sep 17 00:00:00 2001 From: nit Date: Tue, 21 Sep 2010 16:17:48 +0530 Subject: [PATCH] bug 6214: UpdateIso API - Adding account and domain tags. --- server/src/com/cloud/api/commands/UpdateIsoCmd.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) mode change 100644 => 100755 server/src/com/cloud/api/commands/UpdateIsoCmd.java diff --git a/server/src/com/cloud/api/commands/UpdateIsoCmd.java b/server/src/com/cloud/api/commands/UpdateIsoCmd.java old mode 100644 new mode 100755 index b85b4f495e9..5c2ef99dbe7 --- a/server/src/com/cloud/api/commands/UpdateIsoCmd.java +++ b/server/src/com/cloud/api/commands/UpdateIsoCmd.java @@ -103,7 +103,14 @@ public class UpdateIsoCmd extends BaseCmd { isoData.add(new Pair(BaseCmd.Properties.CREATED.getName(), getDateString(updatedIso.getCreated()))); isoData.add(new Pair(BaseCmd.Properties.FORMAT.getName(), updatedIso.getFormat())); isoData.add(new Pair(BaseCmd.Properties.OS_TYPE_ID.getName(), updatedIso.getGuestOSId())); - isoData.add(new Pair(BaseCmd.Properties.BOOTABLE.getName(), updatedIso.isBootable())); + isoData.add(new Pair(BaseCmd.Properties.BOOTABLE.getName(), updatedIso.isBootable())); + // add account ID and name + Account owner = getManagementServer().findAccountById(updatedIso.getAccountId()); + if (owner != null) { + isoData.add(new Pair(BaseCmd.Properties.ACCOUNT.getName(), owner.getAccountName())); + isoData.add(new Pair(BaseCmd.Properties.DOMAIN_ID.getName(), owner.getDomainId())); + isoData.add(new Pair(BaseCmd.Properties.DOMAIN.getName(), getManagementServer().findDomainIdById(owner.getDomainId()).getName())); + } return isoData; } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "internal error updating ISO");