cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prachida...@apache.org
Subject [49/50] [abbrv] git commit: updated refs/heads/rbac to 9e92197
Date Tue, 04 Feb 2014 23:39:33 GMT
Merge branch 'master' into rbac

Conflicts:
	api/src/org/apache/cloudstack/api/command/user/autoscale/ListAutoScaleVmProfilesCmd.java
	api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java
	plugins/network-elements/juniper-contrail/test/org/apache/cloudstack/network/contrail/management/MockAccountManager.java
	server/src/com/cloud/api/ApiServer.java
	server/src/com/cloud/api/query/QueryManagerImpl.java
	server/src/com/cloud/template/TemplateAdapterBase.java
	setup/db/db/schema-430to440.sql
	tools/apidoc/gen_toc.py


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

Branch: refs/heads/rbac
Commit: f84375442e4560e7df7aebe7e58890d94f7ab250
Parents: 72c0f1a 7d0472b
Author: Prachi Damle <prachi@cloud.com>
Authored: Tue Feb 4 12:07:32 2014 -0800
Committer: Prachi Damle <prachi@cloud.com>
Committed: Tue Feb 4 12:07:32 2014 -0800

----------------------------------------------------------------------
 agent/conf/agent.properties                     |    4 +
 api/src/com/cloud/agent/api/to/IpAddressTO.java |   17 +
 api/src/com/cloud/network/Network.java          |    1 +
 api/src/com/cloud/network/NetworkService.java   |    2 +-
 api/src/com/cloud/network/Networks.java         |   17 +-
 .../com/cloud/network/rules/FirewallRule.java   |    3 +-
 api/src/com/cloud/network/vpc/StaticRoute.java  |    3 +-
 api/src/com/cloud/server/ResourceTag.java       |    4 +-
 api/src/com/cloud/storage/Volume.java           |    2 +-
 .../org/apache/cloudstack/api/ApiConstants.java |    1 +
 .../command/admin/alert/GenerateAlertCmd.java   |    2 +-
 .../command/admin/usage/AddTrafficTypeCmd.java  |   14 +-
 .../autoscale/ListAutoScaleVmProfilesCmd.java   |   20 +-
 .../AssignCertToLoadBalancerCmd.java            |    3 +-
 .../RemoveCertFromLoadBalancerCmd.java          |    2 +-
 .../api/command/user/vm/AddIpToVmNicCmd.java    |    2 +-
 .../command/user/volume/ResizeVolumeCmd.java    |    4 +-
 .../config/ApiServiceConfiguration.java         |    2 +-
 awsapi/pom.xml                                  |   10 +-
 .../bridge/io/DimeDelimitedInputStream.java     |   12 +-
 .../com/cloud/bridge/model/SObjectItemVO.java   |    2 +-
 .../bridge/service/EC2SoapServiceImpl.java      |    1 +
 client/tomcatconf/commands.properties.in        |    5 +
 .../com/cloud/agent/api/GetVmConfigAnswer.java  |   68 +
 .../com/cloud/agent/api/GetVmConfigCommand.java |   46 +
 .../agent/api/ModifyVmNicConfigAnswer.java      |   36 +
 .../agent/api/ModifyVmNicConfigCommand.java     |   42 +
 .../api/routing/NetworkElementCommand.java      |   13 +-
 .../virtualnetwork/VirtualRouterDeployer.java   |   27 +
 .../virtualnetwork/VirtualRoutingResource.java  |  826 +++-----
 debian/control                                  |    6 +-
 .../com/cloud/vm/VirtualMachineManagerImpl.java |   29 +-
 .../spring-engine-schema-core-daos-context.xml  |   30 +-
 .../cloud/storage/dao/VMTemplateDaoImpl.java    |   31 +-
 .../com/cloud/upgrade/dao/Upgrade430to440.java  |   58 +-
 .../src/com/cloud/vm/dao/NicSecondaryIpDao.java |    2 +
 .../com/cloud/vm/dao/NicSecondaryIpDaoImpl.java |   13 +
 .../AutoScaleVmGroupDetailVO.java               |   81 +
 .../AutoScaleVmProfileDetailVO.java             |   81 +
 .../dao/AutoScaleVmGroupDetailsDao.java         |   26 +
 .../dao/AutoScaleVmGroupDetailsDaoImpl.java     |   33 +
 .../dao/AutoScaleVmProfileDetailsDao.java       |   26 +
 .../dao/AutoScaleVmProfileDetailsDaoImpl.java   |   33 +
 .../storage/image/TemplateServiceImpl.java      |    8 +
 .../storage/volume/VolumeServiceImpl.java       |   42 +-
 .../src/com/cloud/utils/db/GenericDaoBase.java  |   38 +-
 .../com/cloud/utils/db/GenericDaoBaseTest.java  |  134 ++
 packaging/centos63/cloud.spec                   |    8 +-
 .../AgentShell/AgentService.Designer.cs         |    2 +-
 .../DotNet/ServerResource/AgentShell/App.config |    9 +-
 .../HypervResource/CloudStackTypes.cs           |   22 +-
 .../HypervResource/HypervResourceController.cs  |  162 +-
 .../HypervResource/IWmiCallsV2.cs               |    1 +
 .../ServerResource/HypervResource/Utils.cs      |   10 +
 .../ServerResource/HypervResource/WmiCallsV2.cs |   62 +
 .../hypervisor/hyperv/guru/HypervGuru.java      |  113 ++
 .../hyperv/manager/HypervManager.java           |    1 +
 .../hyperv/manager/HypervManagerImpl.java       |   20 +-
 .../resource/HypervDirectConnectResource.java   |  320 ++--
 .../kvm/resource/LibvirtComputingResource.java  |  338 ++--
 .../hypervisor/kvm/resource/LibvirtVMDef.java   |    2 +
 .../kvm/storage/LibvirtStorageAdaptor.java      |   68 +-
 .../kvm/resource/LibvirtSecretDefTest.java      |   55 +
 .../kvm/resource/LibvirtStoragePoolDefTest.java |   84 +
 .../agent/manager/MockAgentManagerImpl.java     |    7 +
 .../vmware/VmwareServerDiscoverer.java          |    2 +-
 .../vmware/resource/VmwareResource.java         | 1768 +++---------------
 .../resource/VmwareStorageProcessor.java        |   21 +-
 .../motion/VmwareStorageMotionStrategy.java     |    6 +-
 .../xen/resource/CitrixResourceBase.java        | 1418 ++++----------
 .../xen/resource/XenServer56Resource.java       |   44 +-
 .../motion/XenServerStorageMotionStrategy.java  |    8 +-
 .../network-elements/juniper-contrail/pom.xml   |    6 +
 .../cloudstack/contrail/module.properties       |   18 +
 .../contrail/spring-contrail-context.xml        |   54 +
 .../management/ContrailElementImpl.java         |    7 -
 .../contrail/management/ContrailGuru.java       |   24 +-
 .../contrail/management/ContrailManager.java    |   11 +
 .../management/ContrailManagerImpl.java         |  121 +-
 .../management/ContrailVpcElementImpl.java      |  199 ++
 .../contrail/management/ServerDBSyncImpl.java   |   18 +-
 .../contrail/model/NetworkPolicyModel.java      |    2 +-
 .../IntegrationTestConfiguration.java           |   73 +-
 .../management/ManagementServerMock.java        |    6 +-
 .../contrail/management/MockAccountManager.java |    3 -
 .../test/resources/commonContext.xml            |  126 +-
 .../com/cloud/network/nicira/NiciraNvpApi.java  |    6 +-
 .../cloudstack/network/element/SspClient.java   |  258 ++-
 .../cloudstack/network/element/SspElement.java  |   21 +-
 .../stratosphere-ssp/sspmock/sspmock.py         |   58 +-
 .../network/element/SspClientTest.java          |   63 +-
 pom.xml                                         |   97 +-
 scripts/vm/hypervisor/xenserver/vmops           |   15 +-
 server/src/com/cloud/acl/DomainChecker.java     |    4 +-
 .../impl/UserConcentratedAllocator.java         |   47 +-
 server/src/com/cloud/api/ApiDispatcher.java     |    2 +-
 server/src/com/cloud/api/ApiResponseHelper.java |   23 +-
 .../src/com/cloud/api/ApiSerializerHelper.java  |    2 +-
 server/src/com/cloud/api/ApiServer.java         |   25 +-
 server/src/com/cloud/api/ApiServlet.java        |    2 +-
 .../com/cloud/api/EncodedStringTypeAdapter.java |    2 +-
 server/src/com/cloud/api/doc/Alert.java         |   12 +-
 server/src/com/cloud/api/doc/Command.java       |   11 +-
 .../com/cloud/api/query/QueryManagerImpl.java   |   62 +-
 .../cloud/api/query/dao/UserVmJoinDaoImpl.java  |    4 +
 .../com/cloud/api/query/vo/UserVmJoinVO.java    |   32 +-
 .../api/response/ApiResponseSerializer.java     |    2 +-
 server/src/com/cloud/configuration/Config.java  |    5 +-
 .../configuration/ConfigurationManagerImpl.java |   11 +-
 .../com/cloud/consoleproxy/AgentHookBase.java   |    5 +-
 .../consoleproxy/ConsoleProxyManagerImpl.java   |    3 +-
 .../src/com/cloud/dc/DedicatedResourceVO.java   |   15 +-
 .../deploy/DeploymentPlanningManagerImpl.java   |   78 +-
 .../src/com/cloud/event/ActionEventUtils.java   |   14 +-
 .../kvm/discoverer/LibvirtServerDiscoverer.java |   13 -
 .../metadata/ResourceMetaDataManagerImpl.java   |    8 +
 .../network/ExternalIpAddressAllocator.java     |    9 +-
 .../com/cloud/network/IpAddressManagerImpl.java |   36 +-
 .../src/com/cloud/network/NetworkModelImpl.java |    7 +-
 .../com/cloud/network/NetworkServiceImpl.java   |   30 +-
 .../cloud/network/as/AutoScaleManagerImpl.java  |   17 +-
 .../cloud/network/guru/ControlNetworkGuru.java  |    4 +-
 .../cloud/network/guru/PublicNetworkGuru.java   |   14 +-
 .../lb/LoadBalancingRulesManagerImpl.java       |   12 +-
 .../VirtualNetworkApplianceManagerImpl.java     |   16 +-
 .../security/SecurityGroupManagerImpl.java      |    7 +-
 .../com/cloud/network/vpc/VpcManagerImpl.java   |    8 +-
 .../com/cloud/projects/ProjectManagerImpl.java  |    1 +
 .../resourcelimit/ResourceLimitManagerImpl.java |    2 +-
 .../src/com/cloud/server/ManagementServer.java  |    3 +
 .../com/cloud/server/ManagementServerImpl.java  |    9 +-
 server/src/com/cloud/server/StatsCollector.java |   12 +-
 .../cloud/servlet/ConsoleProxyClientParam.java  |   45 +-
 .../com/cloud/servlet/ConsoleProxyServlet.java  |   49 +-
 .../com/cloud/storage/VolumeApiServiceImpl.java |    6 +-
 .../cloud/storage/upload/UploadMonitorImpl.java |    4 +-
 .../cloud/tags/TaggedResourceManagerImpl.java   |    7 +-
 .../template/HypervisorTemplateAdapter.java     |    8 +-
 .../com/cloud/template/TemplateAdapterBase.java |    8 +-
 .../com/cloud/template/TemplateManagerImpl.java |   10 +-
 server/src/com/cloud/test/IPRangeConfig.java    |   29 +-
 server/src/com/cloud/vm/UserVmManagerImpl.java  |   11 +-
 .../vm/snapshot/VMSnapshotManagerImpl.java      |    1 -
 .../com/cloud/vpc/MockNetworkManagerImpl.java   |    4 +-
 .../affinity/AffinityApiUnitTest.java           |    9 +
 .../main/java/common/BufferedImageCanvas.java   |    6 +-
 .../java/common/adapter/AwtCanvasAdapter.java   |    4 +-
 .../src/main/java/rdpclient/RdpClient.java      |   15 +-
 .../adapter/AwtRdpKeyboardAdapter.java          |    2 +-
 .../src/test/java/rdpclient/MockServerTest.java |    4 +-
 services/console-proxy/server/pom.xml           |    5 +
 .../com/cloud/consoleproxy/ConsoleProxy.java    |   20 +-
 .../consoleproxy/ConsoleProxyAjaxHandler.java   |    6 +
 .../consoleproxy/ConsoleProxyClientParam.java   |   32 +-
 .../ConsoleProxyHttpHandlerHelper.java          |   34 +-
 .../consoleproxy/ConsoleProxyRdpClient.java     |  322 ++++
 .../cloud/consoleproxy/rdp/KeysymToKeycode.java |  138 ++
 .../rdp/RdpBufferedImageCanvas.java             |  103 +
 .../resource/NfsSecondaryStorageResource.java   |  216 +--
 .../resource/SecondaryStorageDiscoverer.java    |    7 -
 .../storage/template/DownloadManagerImpl.java   |  355 ++--
 .../storage/template/UploadManagerImpl.java     |  246 +--
 setup/db/db/schema-421to430.sql                 |  201 +-
 setup/db/db/schema-430to440.sql                 |   24 +
 setup/db/templates.simulator.sql                |    8 +-
 .../debian/config/etc/init.d/cloud-early-config |   16 +-
 .../debian/config/opt/cloud/bin/edithosts.sh    |   53 +-
 .../debian/config/opt/cloud/bin/ipassoc.sh      |    3 +-
 systemvm/scripts/_run.sh                        |    7 +
 tools/apidoc/gen_toc.py                         |    3 +-
 tools/appliance/build.sh                        |    6 +-
 .../systemvm64template/postinstall.sh           |    3 +-
 .../definitions/systemvmtemplate/postinstall.sh |    3 +-
 ui/css/cloudstack3.css                          |    1 -
 ui/images/infrastructure-icons.png              |  Bin 62257 -> 62059 bytes
 ui/scripts/instances.js                         |   11 +-
 ui/scripts/network.js                           |    7 +-
 ui/scripts/plugins.js                           |   49 +-
 ui/scripts/system.js                            |  222 ++-
 ui/scripts/ui/widgets/cloudBrowser.js           |   11 +-
 ui/scripts/ui/widgets/listView.js               |   10 +-
 ui/tests/test.widget.listView.js                |  156 ++
 utils/src/com/cloud/utils/ExecutionResult.java  |   44 +
 utils/src/com/cloud/utils/net/NetUtils.java     |   13 +-
 .../cloud/utils/script/OutputInterpreter.java   |    4 +-
 utils/src/com/cloud/utils/script/Script.java    |   15 +-
 .../cloud/hypervisor/vmware/mo/DatastoreMO.java |    9 +-
 .../hypervisor/vmware/util/VmwareClient.java    |   12 +-
 188 files changed, 5820 insertions(+), 4945 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f8437544/api/src/org/apache/cloudstack/api/ApiConstants.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f8437544/api/src/org/apache/cloudstack/api/command/user/autoscale/ListAutoScaleVmProfilesCmd.java
----------------------------------------------------------------------
diff --cc api/src/org/apache/cloudstack/api/command/user/autoscale/ListAutoScaleVmProfilesCmd.java
index b005309,5b4a46e..1affd75
--- a/api/src/org/apache/cloudstack/api/command/user/autoscale/ListAutoScaleVmProfilesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/ListAutoScaleVmProfilesCmd.java
@@@ -18,10 -18,7 +18,7 @@@ package org.apache.cloudstack.api.comma
  
  import java.util.ArrayList;
  import java.util.List;
--
- import org.apache.log4j.Logger;
- 
 +import org.apache.cloudstack.acl.AclEntityType;
  import org.apache.cloudstack.api.APICommand;
  import org.apache.cloudstack.api.ApiConstants;
  import org.apache.cloudstack.api.BaseListProjectAndAccountResourcesCmd;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f8437544/api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java
----------------------------------------------------------------------
diff --cc api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java
index c98289c,e691944..ebcda16
--- a/api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java
@@@ -15,11 -15,7 +15,10 @@@
  // specific language governing permissions and limitations
  // under the License.
  package org.apache.cloudstack.api.command.user.volume;
 -
 +import org.apache.log4j.Logger;
- 
 +import org.apache.cloudstack.acl.AclEntityType;
 +import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 +import org.apache.cloudstack.api.ACL;
  import org.apache.cloudstack.api.APICommand;
  import org.apache.cloudstack.api.ApiCommandJobType;
  import org.apache.cloudstack.api.ApiConstants;
@@@ -31,7 -26,8 +30,6 @@@ import org.apache.cloudstack.api.Server
  import org.apache.cloudstack.api.response.DiskOfferingResponse;
  import org.apache.cloudstack.api.response.VolumeResponse;
  import org.apache.cloudstack.context.CallContext;
- 
 -import org.apache.log4j.Logger;
 -
  import com.cloud.event.EventTypes;
  import com.cloud.exception.InvalidParameterValueException;
  import com.cloud.exception.PermissionDeniedException;
@@@ -51,8 -46,7 +49,8 @@@ public class ResizeVolumeCmd extends Ba
      //////////////// API parameters /////////////////////
      /////////////////////////////////////////////////////
  
 +    @ACL(accessType = AccessType.OperateEntry)
-     @Parameter(name=ApiConstants.ID, entityType=VolumeResponse.class, type=CommandType.UUID,
description="the ID of the disk volume")
+     @Parameter(name = ApiConstants.ID, entityType = VolumeResponse.class, required = true,
type = CommandType.UUID, description = "the ID of the disk volume")
      private Long id;
  
      @Parameter(name = ApiConstants.SIZE, type = CommandType.LONG, required = false, description
= "New volume size in G")

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f8437544/client/tomcatconf/commands.properties.in
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f8437544/engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java
----------------------------------------------------------------------
diff --cc engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java
index 3158905,3b967e7..dc89a15
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java
@@@ -172,43 -126,17 +172,17 @@@ public class Upgrade430to440 implement
  
                              }
                          }
- 
- 
-                         if (networkRs != null) {
-                             try {
 -                        networkRs.close();
 +                                networkRs.close();
-                             } catch (SQLException e) {
-                             }
-                         }
- 
- 
-                         if (pstmtNw != null) {
-                             try {
+                         networkRs = null;
 -                        pstmtNw.close();
 +                                pstmtNw.close();
- 
-                             } catch (SQLException e) {
-                             }
-                         }
- 
+                         pstmtNw = null;
                      }
                  } //if
  
- 
-                 if (vmRs != null) {
-                     try {
+                 pstmtVm.close();
+                 pstmtVm = null;
 -                vmRs.close();
 +                        vmRs.close();
-                     } catch (SQLException e) {
-                     }
-                 }
- 
-                 if (networkRs != null) {
-                     try {
-                         networkRs.close();
-                     } catch (SQLException e) {
-                     }
-                 }
- 
- 
+                 vmRs = null;
              } // while
  
  

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f8437544/plugins/network-elements/juniper-contrail/test/org/apache/cloudstack/network/contrail/management/MockAccountManager.java
----------------------------------------------------------------------
diff --cc plugins/network-elements/juniper-contrail/test/org/apache/cloudstack/network/contrail/management/MockAccountManager.java
index 67dd406,fa7be58..6e2d70d
--- a/plugins/network-elements/juniper-contrail/test/org/apache/cloudstack/network/contrail/management/MockAccountManager.java
+++ b/plugins/network-elements/juniper-contrail/test/org/apache/cloudstack/network/contrail/management/MockAccountManager.java
@@@ -34,7 -34,7 +34,6 @@@ import org.apache.cloudstack.api.comman
  import org.apache.cloudstack.api.command.admin.user.UpdateUserCmd;
  import org.apache.cloudstack.context.CallContext;
  
- import com.cloud.api.query.dao.AccountJoinDao;
 -import com.cloud.api.query.vo.ControlledViewEntity;
  import com.cloud.configuration.ResourceLimit;
  import com.cloud.configuration.dao.ResourceCountDao;
  import com.cloud.domain.Domain;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f8437544/server/src/com/cloud/acl/DomainChecker.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f8437544/server/src/com/cloud/api/ApiDispatcher.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f8437544/server/src/com/cloud/api/ApiResponseHelper.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f8437544/server/src/com/cloud/api/ApiServer.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/api/ApiServer.java
index 3bd2b2a,d715db6..158a897
--- a/server/src/com/cloud/api/ApiServer.java
+++ b/server/src/com/cloud/api/ApiServer.java
@@@ -236,16 -233,14 +235,16 @@@ public class ApiServer extends ManagerB
                  throw new CloudRuntimeException(String.format("%s is claimed as a API command,
but it doesn't have @APICommand annotation", cmdClass.getName()));
              }
              String apiName = at.name();
 -            if (s_apiNameCmdClassMap.containsKey(apiName)) {
 -                s_logger.error("API Cmd class " + cmdClass.getName() + " has non-unique
apiname" + apiName);
 -                continue;
 +            List<Class<?>> apiCmdList = s_apiNameCmdClassMap.get(apiName);
 +            if (apiCmdList == null) {
 +                apiCmdList = new ArrayList<Class<?>>();
 +                s_apiNameCmdClassMap.put(apiName, apiCmdList);
              }
 -            s_apiNameCmdClassMap.put(apiName, cmdClass);
 +            apiCmdList.add(cmdClass);
 +
          }
  
-         encodeApiResponse = Boolean.valueOf(_configDao.getValue(Config.EncodeApiResponse.key()));
+         setEncodeApiResponse(Boolean.valueOf(_configDao.getValue(Config.EncodeApiResponse.key())));
          String jsonType = _configDao.getValue(Config.JavaScriptDefaultContentType.key());
          if (jsonType != null) {
              jsonContentType = jsonType;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f8437544/server/src/com/cloud/api/query/QueryManagerImpl.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/api/query/QueryManagerImpl.java
index 182a5e4,27a0529..6fe65c2
--- a/server/src/com/cloud/api/query/QueryManagerImpl.java
+++ b/server/src/com/cloud/api/query/QueryManagerImpl.java
@@@ -2856,6 -2796,64 +2855,63 @@@ public class QueryManagerImpl extends M
              // search and ignore other query parameters
              sc.addAnd("id", SearchCriteria.Op.EQ, templateId);
          } else {
+ 
+             DomainVO domain = null;
+             if (!permittedAccounts.isEmpty()) {
 -                domain = _domainDao.findById(permittedAccounts.get(0).getDomainId());
++                domain = _domainDao.findById(permittedAccounts.get(0));
+             } else {
+                 domain = _domainDao.findById(Domain.ROOT_DOMAIN);
+             }
+ 
+             // List<HypervisorType> hypers = null;
+             // if (!isIso) {
+             // hypers = _resourceMgr.listAvailHypervisorInZone(null, null);
+             // }
+ 
+             // add criteria for project or not
+             if (listProjectResourcesCriteria == ListProjectResourcesCriteria.SkipProjectResources)
{
+                 sc.addAnd("accountType", SearchCriteria.Op.NEQ, Account.ACCOUNT_TYPE_PROJECT);
+             } else if (listProjectResourcesCriteria == ListProjectResourcesCriteria.ListProjectResourcesOnly)
{
+                 sc.addAnd("accountType", SearchCriteria.Op.EQ, Account.ACCOUNT_TYPE_PROJECT);
+             }
+ 
+             // add criteria for domain path in case of domain admin
+             if ((templateFilter == TemplateFilter.self || templateFilter == TemplateFilter.selfexecutable)
&&
+                 (caller.getType() == Account.ACCOUNT_TYPE_DOMAIN_ADMIN || caller.getType()
== Account.ACCOUNT_TYPE_RESOURCE_DOMAIN_ADMIN)) {
+                 sc.addAnd("domainPath", SearchCriteria.Op.LIKE, domain.getPath() + "%");
+             }
+ 
+             List<Long> relatedDomainIds = new ArrayList<Long>();
 -            List<Long> permittedAccountIds = new ArrayList<Long>();
+             if (!permittedAccounts.isEmpty()) {
 -                for (Account account : permittedAccounts) {
 -                    permittedAccountIds.add(account.getId());
++                for (Long accountId : permittedAccounts) {
++                    Account account = _accountDao.findById(accountId);
+                     boolean publicTemplates = (templateFilter == TemplateFilter.featured
|| templateFilter == TemplateFilter.community);
+ 
+                     // get all parent domain ID's all the way till root domain
+                     DomainVO domainTreeNode = null;
+                     //if template filter is featured, or community, all child domains should
be included in search
+                     if (publicTemplates) {
+                         domainTreeNode = _domainDao.findById(Domain.ROOT_DOMAIN);
+ 
+                     } else {
+                         domainTreeNode = _domainDao.findById(account.getDomainId());
+                     }
+                     relatedDomainIds.add(domainTreeNode.getId());
+                     while (domainTreeNode.getParent() != null) {
+                         domainTreeNode = _domainDao.findById(domainTreeNode.getParent());
+                         relatedDomainIds.add(domainTreeNode.getId());
+                     }
+ 
+                     // get all child domain ID's
+                     if (_accountMgr.isAdmin(account.getType()) || publicTemplates) {
+                         List<DomainVO> allChildDomains = _domainDao.findAllChildren(domainTreeNode.getPath(),
domainTreeNode.getId());
+                         for (DomainVO childDomain : allChildDomains) {
+                             relatedDomainIds.add(childDomain.getId());
+                         }
+                     }
+                 }
+             }
+ 
              if (!isIso) {
                  // add hypervisor criteria for template case
                  if (hypers != null && !hypers.isEmpty()) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f8437544/server/src/com/cloud/api/query/dao/UserVmJoinDaoImpl.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/api/query/dao/UserVmJoinDaoImpl.java
index 92d6d54,08478e2..a5dfb16
--- a/server/src/com/cloud/api/query/dao/UserVmJoinDaoImpl.java
+++ b/server/src/com/cloud/api/query/dao/UserVmJoinDaoImpl.java
@@@ -104,7 -99,11 +104,11 @@@ public class UserVmJoinDaoImpl extends 
          userVmResponse.setId(userVm.getUuid());
          userVmResponse.setName(userVm.getName());
  
+         if (userVm.getDisplayName() != null) {
 -            userVmResponse.setDisplayName(userVm.getDisplayName());
 +        userVmResponse.setDisplayName(userVm.getDisplayName());
+         } else {
+             userVmResponse.setDisplayName(userVm.getName());
+         }
  
          if (userVm.getAccountType() == Account.ACCOUNT_TYPE_PROJECT) {
              userVmResponse.setProjectId(userVm.getProjectUuid());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f8437544/server/src/com/cloud/api/query/vo/UserVmJoinVO.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f8437544/server/src/com/cloud/api/response/ApiResponseSerializer.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f8437544/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/configuration/ConfigurationManagerImpl.java
index ac991d2,0109b4b..5f02004
--- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
+++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
@@@ -1663,35 -1662,35 +1663,35 @@@ public class ConfigurationManagerImpl e
          Transaction.execute(new TransactionCallbackNoReturn() {
              @Override
              public void doInTransactionWithoutResult(TransactionStatus status) {
 -                Map<String, String> updatedDetails = new HashMap<String, String>();
 -                _zoneDao.loadDetails(zone);
 -                if (zone.getDetails() != null) {
 -                    updatedDetails.putAll(zone.getDetails());
 -                }
 -                updatedDetails.putAll(newDetails);
 -                zone.setDetails(updatedDetails);
 -
 -                if (allocationStateStr != null && !allocationStateStr.isEmpty())
{
 -                    Grouping.AllocationState allocationState = Grouping.AllocationState.valueOf(allocationStateStr);
 -
 -                    if (allocationState == Grouping.AllocationState.Enabled) {
 -                        // check if zone has necessary trafficTypes before enabling
 -                        try {
 -                            PhysicalNetwork mgmtPhyNetwork;
 -                            // zone should have a physical network with management
 -                            // traffiType
 +        Map<String, String> updatedDetails = new HashMap<String, String>();
 +        _zoneDao.loadDetails(zone);
 +        if (zone.getDetails() != null) {
 +            updatedDetails.putAll(zone.getDetails());
 +        }
 +        updatedDetails.putAll(newDetails);
 +        zone.setDetails(updatedDetails);
 +
 +        if (allocationStateStr != null && !allocationStateStr.isEmpty()) {
 +            Grouping.AllocationState allocationState = Grouping.AllocationState.valueOf(allocationStateStr);
 +
 +            if (allocationState == Grouping.AllocationState.Enabled) {
 +                // check if zone has necessary trafficTypes before enabling
 +                try {
 +                    PhysicalNetwork mgmtPhyNetwork;
 +                    // zone should have a physical network with management
 +                    // traffiType
                              mgmtPhyNetwork = _networkModel.getDefaultPhysicalNetworkByZoneAndTrafficType(zoneId,
TrafficType.Management);
 -                            if (NetworkType.Advanced == zone.getNetworkType() &&
!zone.isSecurityGroupEnabled()) {
 -                                // advanced zone without SG should have a physical
 -                                // network with public Thpe
 -                                _networkModel.getDefaultPhysicalNetworkByZoneAndTrafficType(zoneId,
TrafficType.Public);
 -                            }
 -
 -                            try {
 -                                _networkModel.getDefaultPhysicalNetworkByZoneAndTrafficType(zoneId,
TrafficType.Storage);
 -                            } catch (InvalidParameterValueException noStorage) {
 +                    if (NetworkType.Advanced == zone.getNetworkType() && !zone.isSecurityGroupEnabled())
{
 +                        // advanced zone without SG should have a physical
 +                        // network with public Thpe
 +                        _networkModel.getDefaultPhysicalNetworkByZoneAndTrafficType(zoneId,
TrafficType.Public);
 +                    }
 +
 +                    try {
 +                        _networkModel.getDefaultPhysicalNetworkByZoneAndTrafficType(zoneId,
TrafficType.Storage);
 +                    } catch (InvalidParameterValueException noStorage) {
                                  PhysicalNetworkTrafficTypeVO mgmtTraffic = _trafficTypeDao.findBy(mgmtPhyNetwork.getId(),
TrafficType.Management);
-                                 _networkSvc.addTrafficTypeToPhysicalNetwork(mgmtPhyNetwork.getId(),
TrafficType.Storage.toString(), mgmtTraffic.getXenNetworkLabel(),
+                                 _networkSvc.addTrafficTypeToPhysicalNetwork(mgmtPhyNetwork.getId(),
TrafficType.Storage.toString(), "vlan", mgmtTraffic.getXenNetworkLabel(),
                                          mgmtTraffic.getKvmNetworkLabel(), mgmtTraffic.getVmwareNetworkLabel(),
mgmtTraffic.getSimulatorNetworkLabel(), mgmtTraffic.getVlan(),
                                          mgmtTraffic.getHypervNetworkLabel());
                                  s_logger.info("No storage traffic type was specified by
admin, create default storage traffic on physical network " + mgmtPhyNetwork.getId()


Mime
View raw message