From 5331e13bacfa4d0c4108cc2deca0b285600116af Mon Sep 17 00:00:00 2001 From: nitin Date: Wed, 18 Aug 2010 12:44:27 +0530 Subject: [PATCH 1/3] 5844 - adding more tags to updateTemplate API --- .../cloud/api/commands/UpdateTemplateCmd.java | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/server/src/com/cloud/api/commands/UpdateTemplateCmd.java b/server/src/com/cloud/api/commands/UpdateTemplateCmd.java index 752a43f8a14..a9095eae749 100644 --- a/server/src/com/cloud/api/commands/UpdateTemplateCmd.java +++ b/server/src/com/cloud/api/commands/UpdateTemplateCmd.java @@ -26,6 +26,7 @@ import org.apache.log4j.Logger; import com.cloud.api.BaseCmd; import com.cloud.api.ServerApiException; +import com.cloud.storage.GuestOS; import com.cloud.storage.VMTemplateVO; import com.cloud.user.Account; import com.cloud.utils.Pair; @@ -104,9 +105,25 @@ public class UpdateTemplateCmd extends BaseCmd { templateData.add(new Pair(BaseCmd.Properties.IS_PUBLIC.getName(), Boolean.valueOf(updatedTemplate.isPublicTemplate()).toString())); templateData.add(new Pair(BaseCmd.Properties.CREATED.getName(), getDateString(updatedTemplate.getCreated()))); templateData.add(new Pair(BaseCmd.Properties.FORMAT.getName(), updatedTemplate.getFormat())); - templateData.add(new Pair(BaseCmd.Properties.OS_TYPE_ID.getName(), updatedTemplate.getGuestOSId())); + GuestOS os = getManagementServer().findGuestOSById(updatedTemplate.getGuestOSId()); + if (os != null) { + templateData.add(new Pair(BaseCmd.Properties.OS_TYPE_ID.getName(), os.getId())); + templateData.add(new Pair(BaseCmd.Properties.OS_TYPE_NAME.getName(), os.getDisplayName())); + } else { + templateData.add(new Pair(BaseCmd.Properties.OS_TYPE_ID.getName(), -1)); + templateData.add(new Pair(BaseCmd.Properties.OS_TYPE_NAME.getName(), "")); + } templateData.add(new Pair(BaseCmd.Properties.PASSWORD_ENABLED.getName(), updatedTemplate.getEnablePassword())); - templateData.add(new Pair(BaseCmd.Properties.CROSS_ZONES.getName(), Boolean.valueOf(updatedTemplate.isCrossZones()).toString())); + templateData.add(new Pair(BaseCmd.Properties.CROSS_ZONES.getName(), Boolean.valueOf(updatedTemplate.isCrossZones()).toString())); + templateData.add(new Pair(BaseCmd.Properties.IS_FEATURED.getName(), Boolean.valueOf(updatedTemplate.isFeatured()).toString())); + + // add account ID and name + Account owner = getManagementServer().findAccountById(updatedTemplate.getAccountId()); + if (owner != null) { + templateData.add(new Pair(BaseCmd.Properties.ACCOUNT.getName(), owner.getAccountName())); + templateData.add(new Pair(BaseCmd.Properties.DOMAIN_ID.getName(), owner.getDomainId())); + templateData.add(new Pair(BaseCmd.Properties.DOMAIN.getName(), getManagementServer().findDomainIdById(owner.getDomainId()).getName())); + } return templateData; } else { throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "internal error updating template"); From 467a4356598608d9949e4d370cdddc5ce25350b5 Mon Sep 17 00:00:00 2001 From: "Manuel Amador (Rudd-O)" Date: Wed, 18 Aug 2010 00:35:38 -0700 Subject: [PATCH 2/3] Revert "Correct name of cloud-qemu package" This reverts commit b3cf83c94eef6540198009b65af3b4cf48fac78e. --- cloud.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloud.spec b/cloud.spec index e4cb4d16367..7e8281fcacd 100644 --- a/cloud.spec +++ b/cloud.spec @@ -233,7 +233,7 @@ Requires: /sbin/service Requires: /sbin/chkconfig Requires: kvm %if "%{fedora}" != "" -Requires: cloud-qemu-system-x86 +Requires: cloud-qemu-system-x86_64 %endif Requires: libcgroup Requires: /usr/bin/uuidgen From b70307eb1aad88d0e0e47d7f0055e7071abdc694 Mon Sep 17 00:00:00 2001 From: "Manuel Amador (Rudd-O)" Date: Wed, 18 Aug 2010 00:35:49 -0700 Subject: [PATCH 3/3] Revert "Added cloud-qemu-system dependency on packages" This reverts commit f8e7b3ff5ff767bfcfd9b8004a4916a9350da953. --- cloud.spec | 3 --- 1 file changed, 3 deletions(-) diff --git a/cloud.spec b/cloud.spec index 7e8281fcacd..b164ab03b7e 100644 --- a/cloud.spec +++ b/cloud.spec @@ -232,9 +232,6 @@ Requires: %{name}-daemonize Requires: /sbin/service Requires: /sbin/chkconfig Requires: kvm -%if "%{fedora}" != "" -Requires: cloud-qemu-system-x86_64 -%endif Requires: libcgroup Requires: /usr/bin/uuidgen Requires: augeas >= 0.7.1