Commit 766640e6 authored by Spiros Koulouzis's avatar Spiros Koulouzis

Fixed null bug with key name-value in building invocation message

parent a1ff1a3a
......@@ -213,7 +213,7 @@
<tbody data-link="row" class="rowlink">
<tr class="clickable-row" data-href="drip-api-php.zip">
<td><span class="downloadfile-name">drip-api-php.zip</span></td>
<td><span class="downloadfile-size">3.75K</span></td>
<td><span class="downloadfile-size">3.76K</span></td>
<td><span class="downloadfile-description">&nbsp;</span></td>
</tr>
</tbody>
......
......@@ -1417,43 +1417,65 @@ module V1
module Types
# (no documentation provided)
class ToscaRepresentation < Nl::Uva::Sne::Drip::Commons::V1::Types::KeyValueHolder
class DeployResponse < Nl::Uva::Sne::Drip::Commons::V1::Types::DeployRequest
# the name
attr_accessor :name
# (no documentation provided)
attr_accessor :key
# the id
attr_accessor :id
# the json hash for this ToscaRepresentation
# the json hash for this DeployResponse
def to_jaxb_json_hash
_h = super
_h['name'] = name.to_jaxb_json_hash unless name.nil?
_h['key'] = key.to_jaxb_json_hash unless key.nil?
_h['id'] = id.to_jaxb_json_hash unless id.nil?
return _h
end
#initializes this ToscaRepresentation with a json hash
#initializes this DeployResponse with a json hash
def init_jaxb_json_hash(_o)
super _o
if !_o['name'].nil?
_oa = _o['name']
if !_o['key'].nil?
_oa = _o['key']
if(_oa.is_a? Hash)
@name = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@name = String.from_json(_oa) unless _oa['@class']
@key = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@key = Nl::Uva::Sne::Drip::Commons::V1::Types::Key.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@name = Array.new
@key = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@name.push String.from_json(_item)
@key.push Nl::Uva::Sne::Drip::Commons::V1::Types::Key.from_json(_item)
else
@name.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
@key.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@name = _oa
@key = _oa
end
end
if !_o['id'].nil?
_oa = _o['id']
if(_oa.is_a? Hash)
@id = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@id = String.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@id = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@id.push String.from_json(_item)
else
@id.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@id = _oa
end
end
end
# constructs a ToscaRepresentation from a (parsed) JSON hash
# constructs a DeployResponse from a (parsed) JSON hash
def self.from_json(o)
if o.nil?
return nil
......@@ -1494,65 +1516,43 @@ module V1
module Types
# (no documentation provided)
class DeployResponse < Nl::Uva::Sne::Drip::Commons::V1::Types::DeployRequest
class ToscaRepresentation < Nl::Uva::Sne::Drip::Commons::V1::Types::KeyValueHolder
# (no documentation provided)
attr_accessor :key
# the id
attr_accessor :id
# the name
attr_accessor :name
# the json hash for this DeployResponse
# the json hash for this ToscaRepresentation
def to_jaxb_json_hash
_h = super
_h['key'] = key.to_jaxb_json_hash unless key.nil?
_h['id'] = id.to_jaxb_json_hash unless id.nil?
_h['name'] = name.to_jaxb_json_hash unless name.nil?
return _h
end
#initializes this DeployResponse with a json hash
#initializes this ToscaRepresentation with a json hash
def init_jaxb_json_hash(_o)
super _o
if !_o['key'].nil?
_oa = _o['key']
if(_oa.is_a? Hash)
@key = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@key = Nl::Uva::Sne::Drip::Commons::V1::Types::Key.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@key = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@key.push Nl::Uva::Sne::Drip::Commons::V1::Types::Key.from_json(_item)
else
@key.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@key = _oa
end
end
if !_o['id'].nil?
_oa = _o['id']
if !_o['name'].nil?
_oa = _o['name']
if(_oa.is_a? Hash)
@id = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@id = String.from_json(_oa) unless _oa['@class']
@name = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@name = String.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@id = Array.new
@name = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@id.push String.from_json(_item)
@name.push String.from_json(_item)
else
@id.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
@name.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@id = _oa
@name = _oa
end
end
end
# constructs a DeployResponse from a (parsed) JSON hash
# constructs a ToscaRepresentation from a (parsed) JSON hash
def self.from_json(o)
if o.nil?
return nil
......
......@@ -68,7 +68,7 @@
<dl class="dl-horizontal">
<dt>Subtypes</dt>
<dd><a href="json_PlaybookRepresentation.html">PlaybookRepresentation</a>, <a href="json_Script.html">Script</a>, <a href="json_ProvisionRequest.html">ProvisionRequest</a>, <a href="json_ToscaRepresentation.html">ToscaRepresentation</a>, <a href="json_DeployRequest.html">DeployRequest</a>, <a href="json_KeyValueHolder.html">KeyValueHolder</a>, <a href="json_PlanResponse.html">PlanResponse</a>, <a href="json_ProvisionResponse.html">ProvisionResponse</a>, <a href="json_DeployResponse.html">DeployResponse</a>, <a href="json_Key.html">Key</a>, <a href="json_CloudCredentials.html">CloudCredentials</a></dd>
<dd><a href="json_PlaybookRepresentation.html">PlaybookRepresentation</a>, <a href="json_Script.html">Script</a>, <a href="json_ProvisionRequest.html">ProvisionRequest</a>, <a href="json_ToscaRepresentation.html">ToscaRepresentation</a>, <a href="json_DeployRequest.html">DeployRequest</a>, <a href="json_KeyValueHolder.html">KeyValueHolder</a>, <a href="json_PlanResponse.html">PlanResponse</a>, <a href="json_DeployResponse.html">DeployResponse</a>, <a href="json_ProvisionResponse.html">ProvisionResponse</a>, <a href="json_Key.html">Key</a>, <a href="json_CloudCredentials.html">CloudCredentials</a></dd>
</dl>
<table class="table datatype-properties">
......
......@@ -187,10 +187,7 @@ public class DeployService {
messageParameter.setEncoding("UTF-8");
String key = null;
for (Key lk : loginKeys) {
String lkName = lk.getName();
if (lkName == null) {
lkName = lk.getAttributes().get("domain_name");
}
String lkName = lk.getAttributes().get("domain_name");
if (lkName.equals(cName)) {
key = lk.getKey();
break;
......
......@@ -45,6 +45,7 @@ def handleDelivery(message):
cluster_type = param["value"]
elif name == "credential":
value = param["value"]
print "Value: %s" %value
ip = param["attributes"]["IP"]
user = param["attributes"]["user"]
role = param["attributes"]["role"]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment