Skip to content

Commit

Permalink
Merge branch 'develop' into feature/alex_fix_deploy_name
Browse files Browse the repository at this point in the history
  • Loading branch information
alexazarh committed Feb 11, 2016
2 parents 0d5ddfc + 42b55aa commit 691e454
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
16 changes: 13 additions & 3 deletions vCenterShell/commands/command_orchestrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,13 +468,23 @@ def _set_vlan_bulk(self, action, default_network, dv_switch_name, dv_switch_path
error_result.actionId = str(action.actionId)
error_result.type = str(action.type)
error_result.infoMessage = str('')
error_result.errorMessage = str(ex)
error_result.errorMessage = self._get_error_message_from_exception(ex)
error_result.success = False
error_result.updatedInterface = None
results.append(error_result)

return results

@staticmethod
def _get_error_message_from_exception(ex):
error_message = ''
if hasattr(ex, 'msg'):
error_message = ex.msg
if hasattr(ex, 'faultMessage'):
if hasattr(ex.faultMessage, 'message'):
error_message += '. ' + ex.faultMessage.message
return error_message

def _remove_vlan_bulk(self, action, default_network, vm_uuid, connection_details):
mappings = []
results = []
Expand Down Expand Up @@ -517,12 +527,12 @@ def _remove_vlan_bulk(self, action, default_network, vm_uuid, connection_details
result.updatedInterface = connection_result.vnic.macAddress
results.append(result)

except Exception:
except Exception as ex:
error_result = ActionResult()
error_result.actionId = str(action.actionId)
error_result.type = str(action.type)
error_result.infoMessage = str('')
error_result.errorMessage = traceback.format_exc()
error_result.errorMessage = self._get_error_message_from_exception(ex)
error_result.success = False
error_result.updatedInterface = None
results.append(error_result)
Expand Down
4 changes: 2 additions & 2 deletions vCenterShellPackage/DataModel/datamodel.xml
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,11 @@
</ns0:AttributeInfo>
</ns0:Attributes>
<ns0:ResourceFamilies>
<ns0:ResourceFamily Description="" IsSearchable="true" Name="Cloud Provider">
<ns0:ResourceFamily Description="" IsSearchable="true" Name="Cloud Provider" IsAdminOnly="true">
<ns0:AttachedAttributes />
<ns0:AttributeValues />
<ns0:Models>
<ns0:ResourceModel Description="" ImagePath="vCenter_Model.png" Name="vCenter" SupportsConcurrentCommands="false">
<ns0:ResourceModel Description="" ImagePath="vCenter_Model.png" Name="vCenter" SupportsConcurrentCommands="true">
<ns0:AttachedAttributes>
<ns0:AttachedAttribute IsLocal="true" IsOverridable="true" Name="User">
<ns0:AllowedValues />
Expand Down

0 comments on commit 691e454

Please sign in to comment.