Liron Ar has uploaded a new change for review.

Change subject: restapi: add disk description mapping
......................................................................

restapi: add disk description mapping

This patch adds the disk description to the disk mapper so that it'll
be passed from the rest to the backend.

Change-Id: I42f5509b06363adfc15427d540e704d5f0cef5ec
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1056245
Signed-off-by: Liron Aravot <[email protected]>
---
M 
backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/DiskMapper.java
M 
backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/DiskMapperTest.java
2 files changed, 7 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/40/24040/1

diff --git 
a/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/DiskMapper.java
 
b/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/DiskMapper.java
index 6b3cfad..1a6ea2e 100644
--- 
a/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/DiskMapper.java
+++ 
b/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/DiskMapper.java
@@ -61,6 +61,11 @@
         if (disk.isSetReadOnly()) {
             engineDisk.setReadOnly(disk.isReadOnly());
         }
+
+        if (disk.isSetDescription()) {
+            engineDisk.setDiskDescription(disk.getDescription());
+        }
+
         if (disk.isSetInterface()) {
             DiskInterface diskInterface = 
DiskInterface.fromValue(disk.getInterface());
             if (diskInterface != null) {
@@ -150,6 +155,7 @@
         model.setActive(entity.getPlugged());
         model.setReadOnly(entity.getReadOnly());
         model.setShareable(entity.isShareable());
+        model.setDescription(entity.getDiskDescription());
         if (entity.getDiskStorageType() == DiskStorageType.IMAGE) {
             mapDiskImageToDiskFields((DiskImage) entity, model);
         } else {
diff --git 
a/backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/DiskMapperTest.java
 
b/backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/DiskMapperTest.java
index 35744a2..600aeee 100644
--- 
a/backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/DiskMapperTest.java
+++ 
b/backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/DiskMapperTest.java
@@ -36,6 +36,7 @@
         assertEquals(model.getInterface(), transform.getInterface());
         assertEquals(model.isActive(), transform.isActive());
         assertEquals(model.isReadOnly(), transform.isReadOnly());
+        assertEquals(model.getDescription(), transform.getDescription());
         assertNotNull(model.getSnapshot());
         assertEquals(model.getSnapshot().getId(), 
transform.getSnapshot().getId());
         assertEquals("unexpected status", model.getStatus().getState(), 
transform.getStatus().getState());


-- 
To view, visit http://gerrit.ovirt.org/24040
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I42f5509b06363adfc15427d540e704d5f0cef5ec
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Liron Ar <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to