Kanagaraj M has uploaded a new change for review.

Change subject: webadmin: allow bricks in root partition
......................................................................

webadmin: allow bricks in root partition

Added a new checkbox to 'allow' the brick directories
can be created a in the root partition.
This is applicable to adding bricks during volume creation
and later.

Selecting this option will send a 'force' parameter to
backend to bypass the 'root partition' performed by gluster.

Change-Id: I55ba2d05422f0a09c242e22e8ae3467e710065b7
Bug-Url: https://bugzilla.redhat.com/1008942
Signed-off-by: Kanagaraj M <kmayi...@redhat.com>
---
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeBrickModel.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeModel.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/volumes/VolumeListModel.java
M 
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java
M 
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/gluster/AddBrickPopupView.java
M 
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/gluster/AddBrickPopupView.ui.xml
6 files changed, 43 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/93/21493/1

diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeBrickModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeBrickModel.java
index b9ada93..d7f6416 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeBrickModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeBrickModel.java
@@ -33,6 +33,8 @@
 
     ListModel bricks;
 
+    EntityModel<Boolean> force;
+
     private UICommand addBrickCommand;
     private UICommand removeBricksCommand;
     private UICommand removeAllBricksCommand;
@@ -56,6 +58,9 @@
         setBrickDirectory(new EntityModel());
 
         setBricks(new ListModel());
+
+        setForce(new EntityModel<Boolean>());
+        getForce().setEntity(false);
 
         setAddBrickCommand(new UICommand("AddBrick", this)); //$NON-NLS-1$
         setRemoveBricksCommand(new UICommand("RemoveBricks", this)); 
//$NON-NLS-1$
@@ -260,6 +265,14 @@
         this.bricks = selectedBricks;
     }
 
+    public EntityModel<Boolean> getForce() {
+        return force;
+    }
+
+    public void setForce(EntityModel<Boolean> force) {
+        this.force = force;
+    }
+
     public boolean validateAddBricks(GlusterVolumeType selectedVolumeType)
     {
         boolean valid = true;
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeModel.java
index ba6ac84..cb06f45 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeModel.java
@@ -48,6 +48,8 @@
     EntityModel allowAccess;
     EntityModel optimizeForVirtStore;
 
+    private boolean forceAddBricks;
+
     private UICommand addBricksCommand;
 
     public UICommand getAddBricksCommand()
@@ -282,6 +284,14 @@
         this.optimizeForVirtStore = optimizeForVirtStore;
     }
 
+    public boolean isForceAddBricks() {
+        return this.forceAddBricks;
+    }
+
+    public void setForceAddBricks(boolean forceAddBricks) {
+        this.forceAddBricks = forceAddBricks;
+    }
+
     public void addBricks(){
         if (getWindow() != null || getCluster().getSelectedItem() == null)
         {
@@ -299,6 +309,8 @@
         
volumeBrickModel.getStripeCount().setEntity(getStripeCount().getEntity());
         volumeBrickModel.getStripeCount().setIsChangable(true);
         
volumeBrickModel.getStripeCount().setIsAvailable(getStripeCount().getIsAvailable());
+
+        volumeBrickModel.getForce().setEntity(isForceAddBricks());
 
         setWindow(volumeBrickModel);
         
volumeBrickModel.setTitle(ConstantsManager.getInstance().getConstants().addBricksTitle());
@@ -422,6 +434,9 @@
         brickListModel.setSelectedItems(brickList);
 
         setBricks(brickListModel);
+
+        setForceAddBricks(volumeBrickModel.getForce().getEntity());
+
         setWindow(null);
     }
 
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/volumes/VolumeListModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/volumes/VolumeListModel.java
index 68e196c..d38c3cc 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/volumes/VolumeListModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/volumes/VolumeListModel.java
@@ -862,7 +862,8 @@
 
         volumeModel.startProgress(null);
 
-        CreateGlusterVolumeParameters parameter = new 
CreateGlusterVolumeParameters(volume);
+        CreateGlusterVolumeParameters parameter =
+                new CreateGlusterVolumeParameters(volume, 
volumeModel.isForceAddBricks());
 
         Frontend.RunAction(VdcActionType.CreateGlusterVolume, parameter, new 
IFrontendActionAsyncCallback() {
 
diff --git 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java
 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java
index 88dad08..3189fe2 100644
--- 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java
+++ 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java
@@ -2710,6 +2710,9 @@
     @DefaultStringValue("NOTE: Stripe groups will be create based on the order 
of the bricks.")
     String distributedStripeVolumeBrickInfoLabel();
 
+    @DefaultStringValue("Allow bricks in root partition")
+    String allowBricksInRootPartition();
+
     @DefaultStringValue("Migrate Data from the bricks")
     String removeBricksMigrateData();
 
diff --git 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/gluster/AddBrickPopupView.java
 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/gluster/AddBrickPopupView.java
index 0fd2a82..41db1b1 100644
--- 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/gluster/AddBrickPopupView.java
+++ 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/gluster/AddBrickPopupView.java
@@ -12,6 +12,7 @@
 import org.ovirt.engine.ui.common.widget.editor.EntityModelLabelEditor;
 import org.ovirt.engine.ui.common.widget.editor.EntityModelTextBoxEditor;
 import org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor;
+import 
org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor;
 import org.ovirt.engine.ui.common.widget.parser.EntityModelParser;
 import org.ovirt.engine.ui.common.widget.renderer.EnumRenderer;
 import org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer;
@@ -108,6 +109,11 @@
     @UiField
     @Ignore
     Label infoLabel;
+
+    @UiField
+    @Path(value = "force.entity")
+    @WithElementId
+    EntityModelCheckBoxEditor forceEditor;
 
     @UiField
     @Ignore
@@ -235,6 +241,7 @@
         removeAllBricksButton.setLabel(constants.removeAllBricksButtonLabel());
         moveBricksUpButton.setLabel(constants.moveBricksUpButtonLabel());
         moveBricksDownButton.setLabel(constants.moveBricksDownButtonLabel());
+        forceEditor.setLabel(constants.allowBricksInRootPartition());
     }
 
     @Override
diff --git 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/gluster/AddBrickPopupView.ui.xml
 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/gluster/AddBrickPopupView.ui.xml
index fb25401..c3489f6 100644
--- 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/gluster/AddBrickPopupView.ui.xml
+++ 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/gluster/AddBrickPopupView.ui.xml
@@ -2,7 +2,8 @@
 <!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent";>
 <ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
        xmlns:g="urn:import:com.google.gwt.user.client.ui" 
xmlns:d="urn:import:org.ovirt.engine.ui.common.widget.dialog"
-       xmlns:e="urn:import:org.ovirt.engine.ui.common.widget.editor" 
xmlns:w="urn:import:org.ovirt.engine.ui.common.widget">
+       xmlns:e="urn:import:org.ovirt.engine.ui.common.widget.editor" 
xmlns:w="urn:import:org.ovirt.engine.ui.common.widget"
+       xmlns:n="urn:import:org.ovirt.engine.ui.common.widget.editor.generic">
 
        <ui:style 
type="org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster.AddBrickPopupView.WidgetStyle">
                .generalTabTopDecorator {
@@ -90,7 +91,7 @@
                                                        <w:UiCommandButton 
ui:field="moveBricksDownButton" addStyleNames="{style.brickButton}"/>
                                                </g:VerticalPanel>
                                </g:HorizontalPanel>
-
+                               <n:EntityModelCheckBoxEditor 
ui:field="forceEditor"/>
                                <g:Label ui:field="messageLabel" 
addStyleNames="{style.messageLabel}" />
 
                        </g:VerticalPanel>


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I55ba2d05422f0a09c242e22e8ae3467e710065b7
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Kanagaraj M <kmayi...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to