lib/providers/openstack/openstack.rb in lorj-1.0.6 vs lib/providers/openstack/openstack.rb in lorj-1.0.7
- old
+ new
@@ -314,16 +314,20 @@
" Valid one are : '%s'",
key[0],
oControlerObject.class,
oControlerObject.class.attributes unless
oControlerObject.class.attributes.include?(key[0])
-
return attributes.rh_get(key) if attributes.rh_exist?(key)
- return oControlerObject.send(key[0]) if key.length == 1
- oControlerObject.send(key[0]).rh_get(key[1..-1])
+ _get_instance_attr(oControlerObject, key)
end
rescue => e
controller_error "==>Unable to map '%s'. %s", key, e.message
+ end
+
+ def _get_instance_attr(oControlerObject, key)
+ return nil if oControlerObject.send(key[0]).nil?
+ return oControlerObject.send(key[0]) if key.length == 1
+ oControlerObject.send(key[0]).rh_get(key[1..-1])
end
end
# Following class describe how FORJ should handle Openstack Cloud objects.
class OpenstackController