You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bh...@apache.org on 2016/12/08 18:56:54 UTC

[1/4] git commit: updated refs/heads/4.9 to 80724b0

Repository: cloudstack
Updated Branches:
  refs/heads/4.9 26a2c9ee9 -> 80724b01b


CLOUDSTACK-9269: Missing field for Switch type for Management and Storage traffic types

Showing vswitchtype for all traffic types in case of VMware.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/13e66c5e
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/13e66c5e
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/13e66c5e

Branch: refs/heads/4.9
Commit: 13e66c5e78db58e45124feba26fac88b9dc68b45
Parents: decb2e4
Author: Nitin Kumar Maharana <ni...@gmail.com>
Authored: Tue Feb 2 23:23:42 2016 +0530
Committer: Nitin Kumar Maharana <ni...@accelerite.com>
Committed: Wed Dec 7 13:38:02 2016 +0530

----------------------------------------------------------------------
 ui/scripts/ui-custom/zoneWizard.js | 100 ++++++++++++++++----------------
 1 file changed, 49 insertions(+), 51 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/13e66c5e/ui/scripts/ui-custom/zoneWizard.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui-custom/zoneWizard.js b/ui/scripts/ui-custom/zoneWizard.js
index f8e8e20..e659df0 100644
--- a/ui/scripts/ui-custom/zoneWizard.js
+++ b/ui/scripts/ui-custom/zoneWizard.js
@@ -310,69 +310,67 @@
                 };
 
                 if(zoneType == 'Advanced') {
-                    if($trafficType.hasClass('guest') || $trafficType.hasClass('public')) {
-                        if(trafficData.vSwitchType == null) {
-                             var useDvs = false;
+                    if(trafficData.vSwitchType == null) {
+                         var useDvs = false;
+                         $.ajax({
+                             url: createURL('listConfigurations'),
+                             data: {
+                                 name: 'vmware.use.dvswitch'
+                             },
+                             async: false,
+                             success: function(json) {
+                                 if (json.listconfigurationsresponse.configuration[0].value == 'true') {
+                                     useDvs = true;
+                                 }
+                             }
+                         });
+                         if (useDvs == true) {
+                             var useNexusDvs = false;
                              $.ajax({
                                  url: createURL('listConfigurations'),
                                  data: {
-                                     name: 'vmware.use.dvswitch'
+                                     name: 'vmware.use.nexus.vswitch'
                                  },
                                  async: false,
                                  success: function(json) {
                                      if (json.listconfigurationsresponse.configuration[0].value == 'true') {
-                                         useDvs = true;
+                                         useNexusDvs = true;
                                      }
                                  }
                              });
-                             if (useDvs == true) {
-                                 var useNexusDvs = false;
-                                 $.ajax({
-                                     url: createURL('listConfigurations'),
-                                     data: {
-                                         name: 'vmware.use.nexus.vswitch'
-                                     },
-                                     async: false,
-                                     success: function(json) {
-                                         if (json.listconfigurationsresponse.configuration[0].value == 'true') {
-                                             useNexusDvs = true;
-                                         }
-                                     }
-                                 });
-                                 if (useNexusDvs == true) {
-                                     trafficData.vSwitchType = 'nexusdvs';
-                                     fields.vSwitchName.defaultValue = 'epp0';
-                                 } else {
-                                     trafficData.vSwitchType = 'vmwaredvs';
-                                     fields.vSwitchName.defaultValue = 'dvSwitch0';
-                                 }
-                             } else { //useDvs == false
-                                 trafficData.vSwitchType = 'vmwaresvs';
-                                 fields.vSwitchName.defaultValue = 'vSwitch0';
+                             if (useNexusDvs == true) {
+                                 trafficData.vSwitchType = 'nexusdvs';
+                                 fields.vSwitchName.defaultValue = 'epp0';
+                             } else {
+                                 trafficData.vSwitchType = 'vmwaredvs';
+                                 fields.vSwitchName.defaultValue = 'dvSwitch0';
                              }
-                        }
-
-                        $.extend(fields, {
-                            vSwitchType: {
-                                    label: 'label.vSwitch.type',
-                                select: function (args) {
-                                    args.response.success({
-                                        data: [{
-                                            id: 'nexusdvs',
-                                            description: 'Cisco Nexus 1000v Distributed Virtual Switch'
-                                        }, {
-                                            id: 'vmwaresvs',
-                                            description: 'VMware vNetwork Standard Virtual Switch'
-                                        }, {
-                                            id: 'vmwaredvs',
-                                            description: 'VMware vNetwork Distributed Virtual Switch'
-                                        }]
-                                    });
-                                },
-                                defaultValue: trafficData.vSwitchType
-                            }
-                        });
+                         } else { //useDvs == false
+                             trafficData.vSwitchType = 'vmwaresvs';
+                             fields.vSwitchName.defaultValue = 'vSwitch0';
+                         }
                     }
+
+                    $.extend(fields, {
+                        vSwitchType: {
+                                label: 'label.vSwitch.type',
+                            select: function (args) {
+                                args.response.success({
+                                    data: [{
+                                        id: 'nexusdvs',
+                                        description: 'Cisco Nexus 1000v Distributed Virtual Switch'
+                                    }, {
+                                        id: 'vmwaresvs',
+                                        description: 'VMware vNetwork Standard Virtual Switch'
+                                    }, {
+                                        id: 'vmwaredvs',
+                                        description: 'VMware vNetwork Distributed Virtual Switch'
+                                    }]
+                                });
+                            },
+                            defaultValue: trafficData.vSwitchType
+                        }
+                    });
                 }
             } else {
                 fields = {


[4/4] git commit: updated refs/heads/4.9 to 80724b0

Posted by bh...@apache.org.
Merge pull request #1396 from nitin-maharana/CloudStack-Nitin26_4.7

CLOUDSTACK-9269: Missing field for Switch type for Management and Storage traffic types# Repro Steps:

Create an Advanced zone(VMware).
Configure physical network.
Edit traffic type (Management or Storage)
Observe the switch type dropdown list is missing.

If we choose Guest or Public the dropdown is visible. See the below snapshots.
# Expected Result:

The list should be shown in case of Management and storage.
# Actual Result:

The list is missing in case of management and storage.
# Fix:

Showing vswitchtype for all traffic types in case of VMware.
# Traffic Type - Guest:

![public-nitin](https://cloud.githubusercontent.com/assets/12583725/12759158/aec4d38e-ca05-11e5-911f-d8aa8cb995b7.jpg)
# Traffic Type - Management (Issue):

![management-nitin](https://cloud.githubusercontent.com/assets/12583725/12759171/bff00e08-ca05-11e5-8051-c24f0952a321.jpg)

* pr/1396:
  CLOUDSTACK-9269: Missing field for Switch type for Management and Storage traffic types

Signed-off-by: Rohit Yadav <ro...@shapeblue.com>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/80724b01
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/80724b01
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/80724b01

Branch: refs/heads/4.9
Commit: 80724b01bcf9e8a827f60e93b8f575cc2b24922b
Parents: 227c088 13e66c5
Author: Rohit Yadav <ro...@shapeblue.com>
Authored: Fri Dec 9 00:26:30 2016 +0530
Committer: Rohit Yadav <ro...@shapeblue.com>
Committed: Fri Dec 9 00:26:30 2016 +0530

----------------------------------------------------------------------
 ui/scripts/ui-custom/zoneWizard.js | 100 ++++++++++++++++----------------
 1 file changed, 49 insertions(+), 51 deletions(-)
----------------------------------------------------------------------



[2/4] git commit: updated refs/heads/4.9 to 80724b0

Posted by bh...@apache.org.
CLOUDSTACK-9656: Preventing autoboxing NPE in Usage by setting a default role when not found


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/1a034d16
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/1a034d16
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/1a034d16

Branch: refs/heads/4.9
Commit: 1a034d168deed4187ebb40215c1dc217778a66d1
Parents: 26a2c9e
Author: Patrick Dube <pd...@cloudops.com>
Authored: Thu Dec 8 13:26:46 2016 -0500
Committer: Patrick Dube <pd...@cloudops.com>
Committed: Thu Dec 8 13:26:46 2016 -0500

----------------------------------------------------------------------
 engine/schema/src/com/cloud/usage/dao/UsageDaoImpl.java | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1a034d16/engine/schema/src/com/cloud/usage/dao/UsageDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/usage/dao/UsageDaoImpl.java b/engine/schema/src/com/cloud/usage/dao/UsageDaoImpl.java
index 39f57df..626b8cc 100644
--- a/engine/schema/src/com/cloud/usage/dao/UsageDaoImpl.java
+++ b/engine/schema/src/com/cloud/usage/dao/UsageDaoImpl.java
@@ -32,6 +32,7 @@ import com.cloud.utils.db.TransactionLegacy;
 import com.cloud.utils.db.TransactionStatus;
 import com.cloud.utils.exception.CloudRuntimeException;
 
+import org.apache.cloudstack.acl.RoleType;
 import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
@@ -113,7 +114,14 @@ public class UsageDaoImpl extends GenericDaoBase<UsageVO, Long> implements Usage
                 pstmt.setLong(1, acct.getId());
                 pstmt.setString(2, acct.getAccountName());
                 pstmt.setShort(3, acct.getType());
-                pstmt.setLong(4, acct.getRoleId());
+
+                //prevent autoboxing NPE by defaulting to User role
+                if(acct.getRoleId() == null){
+                    pstmt.setLong(4, RoleType.User.getId());
+                }else{
+                    pstmt.setLong(4, acct.getRoleId());
+                }
+
                 pstmt.setLong(5, acct.getDomainId());
 
                 Date removed = acct.getRemoved();


[3/4] git commit: updated refs/heads/4.9 to 80724b0

Posted by bh...@apache.org.
Merge pull request #1820 from pdube/CLOUDSTACK-9656-usage-exception

CLOUDSTACK-9656 Preventing autoboxing NPE in Usage by setting a default role when not foundhttps://issues.apache.org/jira/browse/CLOUDSTACK-9656

This is a workaround to avoid NPE when using the usage server with Projects

To reproduce bug:

Create project
Add account to project
Create VM within that project
Run the usage server

Same steps to test resolution

* pr/1820:
  CLOUDSTACK-9656: Preventing autoboxing NPE in Usage by setting a default role when not found

Signed-off-by: Rohit Yadav <ro...@shapeblue.com>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/227c088d
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/227c088d
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/227c088d

Branch: refs/heads/4.9
Commit: 227c088d77b50722c64d449a3ff72deb277388b8
Parents: 26a2c9e 1a034d1
Author: Rohit Yadav <ro...@shapeblue.com>
Authored: Fri Dec 9 00:25:48 2016 +0530
Committer: Rohit Yadav <ro...@shapeblue.com>
Committed: Fri Dec 9 00:25:48 2016 +0530

----------------------------------------------------------------------
 engine/schema/src/com/cloud/usage/dao/UsageDaoImpl.java | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------