require 'OpenNebula'

include OpenNebula

class VirtualNetworkPoolOCCI < VirtualNetworkPool
    OCCI_NETWORK_POOL = %q{
        <NETWORK><% 
             if network_pool_hash['VNET_POOL'] != nil       
                  vnlist=[network_pool_hash['VNET_POOL']['VNET']].flatten
                  vnlist.each{|network|%>
            <NIC href="<%= base_url %>/network/<%= network['ID'].strip %>"/><%
                  } 
              end %>
        </NETWORK>       
    }.gsub(/^        /, '')
    
    # Creates the OCCI representation of a Virtual Network
    def to_occi(base_url)   
      network_pool_hash=to_hash
      
      occi = ERB.new(OCCI_NETWORK_POOL)
      return occi.result(binding)
    end
end

require 'OpenNebula'

include OpenNebula

class VirtualNetworkPoolOCCI < VirtualNetworkPool
    OCCI_NETWORK_POOL = %q{
        <NETWORKS><% 
             if network_pool_hash['VNET_POOL'] != nil       
                  vnlist=[network_pool_hash['VNET_POOL']['VNET']].flatten
                  vnlist.each{|network|%>
            <NETWORK href="<%= base_url %>/network/<%= network['ID'].strip
%>"/><%
                  } 
              end %>
        </NETWORKS>       
    }.gsub(/^        /, '')
    
    # Creates the OCCI representation of a Virtual Network
    def to_occi(base_url)   
      network_pool_hash=to_hash
      
      occi = ERB.new(OCCI_NETWORK_POOL)
      return occi.result(binding)
    end
end

Fix Network names when rendering the Network pool resource
Fix Network names when rendering the Network pool resource


git-svn-id: addd40251ba30a5efebfaf2146a7968786ebe177@968 3034c82b-c49b-4eb3-8279-a7acafdc01c0
