[GitHub] cloudstack pull request: CLOUDSTACK-8820: Showing error when try t...

2015-09-14 Thread sureshanaparti
Github user sureshanaparti commented on the pull request:

https://github.com/apache/cloudstack/pull/806#issuecomment-140009394
  
@remibergsma That sounds good.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8820: Showing error when try t...

2015-09-14 Thread sureshanaparti
Github user sureshanaparti commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/806#discussion_r39372846
  
--- Diff: 
vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareClient.java ---
@@ -152,13 +152,26 @@ public void connect(String url, String userName, 
String password) throws Excepti
 @SuppressWarnings("unchecked")
 Map> headers = (Map>)((BindingProvider)vimPort).getResponseContext().get(MessageContext.HTTP_RESPONSE_HEADERS);
 List cookies = headers.get("Set-cookie");
+
+vimPort.login(serviceContent.getSessionManager(), userName, 
password, null);
+
+if (cookies == null) {
+@SuppressWarnings("unchecked")
--- End diff --

to suppress the warnings for the unchecked cast from Object to 
Map> on extracting the http response headers from the 
response context. This is also set on vmware sample programs.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8820: Showing error when try t...

2015-09-13 Thread bhaisaab
Github user bhaisaab commented on the pull request:

https://github.com/apache/cloudstack/pull/806#issuecomment-139962348
  
@remibergsma sure, but can do this next week (lack infra right now)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8820: Showing error when try t...

2015-09-12 Thread remibergsma
Github user remibergsma commented on the pull request:

https://github.com/apache/cloudstack/pull/806#issuecomment-139787067
  
@sureshanaparti Nice work! The PR title confused me a bit though. What 
about:
CLOUDSTACK-8820: Support for VMware vCenter 6 data center

@bhaisaab Would appreciate it if you could test this. Thanks! Nice feature 
to go with ACS 4.6 :-)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8820: Showing error when try t...

2015-09-11 Thread DaanHoogland
Github user DaanHoogland commented on the pull request:

https://github.com/apache/cloudstack/pull/806#issuecomment-139532380
  
change makes sense but I have some comments on the coding style.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8820: Showing error when try t...

2015-09-11 Thread DaanHoogland
Github user DaanHoogland commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/806#discussion_r39265179
  
--- Diff: 
vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareClient.java ---
@@ -577,41 +590,48 @@ public ManagedObjectReference 
getDecendentMoRef(ManagedObjectReference root, Str
 return null;
 }
 
-// Create PropertySpecs
-PropertySpec pSpec = new PropertySpec();
-pSpec.setType(type);
-pSpec.setAll(false);
-pSpec.getPathSet().add("name");
-
-ObjectSpec oSpec = new ObjectSpec();
-oSpec.setObj(root);
-oSpec.setSkip(false);
-oSpec.getSelectSet().addAll(constructCompleteTraversalSpec());
-
-PropertyFilterSpec spec = new PropertyFilterSpec();
-spec.getPropSet().add(pSpec);
-spec.getObjectSet().add(oSpec);
-List specArr = new 
ArrayList();
-specArr.add(spec);
-
-List ocary = 
vimPort.retrieveProperties(getPropCol(), specArr);
-
-if (ocary == null || ocary.size() == 0) {
-return null;
-}
+try {
+// Create PropertySpecs
+PropertySpec pSpec = new PropertySpec();
+pSpec.setType(type);
+pSpec.setAll(false);
+pSpec.getPathSet().add("name");
+
+ObjectSpec oSpec = new ObjectSpec();
+oSpec.setObj(root);
+oSpec.setSkip(false);
+oSpec.getSelectSet().addAll(constructCompleteTraversalSpec());
+
+PropertyFilterSpec spec = new PropertyFilterSpec();
+spec.getPropSet().add(pSpec);
+spec.getObjectSet().add(oSpec);
+List specArr = new 
ArrayList();
+specArr.add(spec);
+
+ManagedObjectReference propCollector = getPropCol();
+List ocary = 
vimPort.retrieveProperties(propCollector, specArr);
+
+if (ocary == null || ocary.size() == 0) {
+return null;
+}
 
-// filter through retrieved objects to get the first match.
-for (ObjectContent oc : ocary) {
-ManagedObjectReference mor = oc.getObj();
-List propary = oc.getPropSet();
-if (type == null || type.equals(mor.getType())) {
-if (propary.size() > 0) {
-String propval = (String)propary.get(0).getVal();
-if (propval != null && name.equalsIgnoreCase(propval))
-return mor;
+// filter through retrieved objects to get the first match.
+for (ObjectContent oc : ocary) {
+ManagedObjectReference mor = oc.getObj();
+List propary = oc.getPropSet();
+if (type == null || type.equals(mor.getType())) {
+if (propary.size() > 0) {
+String propval = (String)propary.get(0).getVal();
+if (propval != null && 
name.equalsIgnoreCase(propval))
+return mor;
+}
 }
 }
+} catch (Exception e) {
+s_logger.debug("Failed to get mor for name: " + name + " and 
type: " + type, e);
--- End diff --

(mor == more || mor is MoRef)?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8820: Showing error when try t...

2015-09-11 Thread DaanHoogland
Github user DaanHoogland commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/806#discussion_r39265110
  
--- Diff: 
vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareClient.java ---
@@ -577,41 +590,48 @@ public ManagedObjectReference 
getDecendentMoRef(ManagedObjectReference root, Str
 return null;
 }
 
-// Create PropertySpecs
-PropertySpec pSpec = new PropertySpec();
-pSpec.setType(type);
-pSpec.setAll(false);
-pSpec.getPathSet().add("name");
-
-ObjectSpec oSpec = new ObjectSpec();
-oSpec.setObj(root);
-oSpec.setSkip(false);
-oSpec.getSelectSet().addAll(constructCompleteTraversalSpec());
-
-PropertyFilterSpec spec = new PropertyFilterSpec();
-spec.getPropSet().add(pSpec);
-spec.getObjectSet().add(oSpec);
-List specArr = new 
ArrayList();
-specArr.add(spec);
-
-List ocary = 
vimPort.retrieveProperties(getPropCol(), specArr);
-
-if (ocary == null || ocary.size() == 0) {
-return null;
-}
+try {
+// Create PropertySpecs
+PropertySpec pSpec = new PropertySpec();
+pSpec.setType(type);
+pSpec.setAll(false);
+pSpec.getPathSet().add("name");
+
+ObjectSpec oSpec = new ObjectSpec();
+oSpec.setObj(root);
+oSpec.setSkip(false);
+oSpec.getSelectSet().addAll(constructCompleteTraversalSpec());
+
+PropertyFilterSpec spec = new PropertyFilterSpec();
+spec.getPropSet().add(pSpec);
+spec.getObjectSet().add(oSpec);
+List specArr = new 
ArrayList();
+specArr.add(spec);
+
+ManagedObjectReference propCollector = getPropCol();
+List ocary = 
vimPort.retrieveProperties(propCollector, specArr);
+
+if (ocary == null || ocary.size() == 0) {
+return null;
+}
 
-// filter through retrieved objects to get the first match.
-for (ObjectContent oc : ocary) {
-ManagedObjectReference mor = oc.getObj();
-List propary = oc.getPropSet();
-if (type == null || type.equals(mor.getType())) {
-if (propary.size() > 0) {
-String propval = (String)propary.get(0).getVal();
-if (propval != null && name.equalsIgnoreCase(propval))
-return mor;
+// filter through retrieved objects to get the first match.
+for (ObjectContent oc : ocary) {
+ManagedObjectReference mor = oc.getObj();
+List propary = oc.getPropSet();
+if (type == null || type.equals(mor.getType())) {
+if (propary.size() > 0) {
+String propval = (String)propary.get(0).getVal();
+if (propval != null && 
name.equalsIgnoreCase(propval))
+return mor;
+}
 }
 }
+} catch (Exception e) {
--- End diff --

please catch specific exceptions, not just anything


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8820: Showing error when try t...

2015-09-11 Thread DaanHoogland
Github user DaanHoogland commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/806#discussion_r39265018
  
--- Diff: 
vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareClient.java ---
@@ -152,13 +152,26 @@ public void connect(String url, String userName, 
String password) throws Excepti
 @SuppressWarnings("unchecked")
 Map> headers = (Map>)((BindingProvider)vimPort).getResponseContext().get(MessageContext.HTTP_RESPONSE_HEADERS);
 List cookies = headers.get("Set-cookie");
+
+vimPort.login(serviceContent.getSessionManager(), userName, 
password, null);
+
+if (cookies == null) {
+@SuppressWarnings("unchecked")
--- End diff --

why suppress? please add a comment


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8820: Showing error when try t...

2015-09-11 Thread bhaisaab
Github user bhaisaab commented on the pull request:

https://github.com/apache/cloudstack/pull/806#issuecomment-139521285
  
Great PR @sureshanaparti I was going to work on supporting this as ESXi6 
works well on top of KVM; I can test this for you next week; LGTM on code 
change (not tested though)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] cloudstack pull request: CLOUDSTACK-8820: Showing error when try t...

2015-09-11 Thread sureshanaparti
GitHub user sureshanaparti opened a pull request:

https://github.com/apache/cloudstack/pull/806

CLOUDSTACK-8820: Showing error when try to add vCenter 6

CLOUDSTACK-8820: Showing error when try to add advance zone using VMware 
ESXi 6.0 host

Summary: In vCenter 6.0, response headers need to be fetched after service 
login for server cookie unlike previous versions of vCenter.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/sureshanaparti/cloudstack CLOUDSTACK-8820

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/cloudstack/pull/806.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #806


commit 4a6e2cdeeecae6953245ce3213513f4d5dd82e7f
Author: Suresh Kumar Anaparti 
Date:   2015-09-11T10:09:09Z

CLOUDSTACK-8820: Showing error when try to add advance zone using VMWare 
ESXi 6.0 host
Summary: In vCenter 6.0, response headers need to be fetched after service 
login for server cookie unlike previous versions of vCenter.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---