Revision 9865a93c

View differences:

src/cloud/occi/lib/ImageOCCI.rb
27 27
            <SIZE><%= ((size/1024)/1024).to_s %></SIZE>
28 28
            <URL><%= description %></URL>
29 29
        </DISK>
30
    }.gsub(/^        /, '')
30
    }
31 31

  
32 32

  
33 33
    # Creates the OCCI representation of an Image
34 34
    def to_occi()
35 35
        occi = ERB.new(OCCI_IMAGE)
36
        return occi.result(binding)
36
        return occi.result(binding).gsub(/\n\s*/,'')
37 37
    end
38 38
end
src/cloud/occi/lib/ImagePoolOCCI.rb
26 26
            <DISK href="<%= base_url%>/storage/<%= image[:id] %>"/><%  
27 27
            end  %>
28 28
        </STORAGE>
29
    }.gsub(/^        /, '')
29
    }
30 30
        
31 31
    def initialize(user_id)
32 32
        @images=Image.filter(:owner => user_id)     
......
34 34
    
35 35
    def to_occi(base_url)
36 36
        occi = ERB.new(OCCI_IMAGE_POOL)
37
        return occi.result(binding)       
37
        return occi.result(binding).gsub(/\n\s*/,'')
38 38
    end
39 39
end
40 40

  
src/cloud/occi/lib/VirtualMachineOCCI.rb
35 35
            <INSTANCE_TYPE><%=template['INSTANCE_TYPE']%></INSTANCE_TYPE><%
36 36
             end %>
37 37
        </COMPUTE>     
38
    }.gsub(/^        /, '')
38
    }
39 39
    
40 40
    
41 41
    # Creates the VMI representation of a Virtual Machine
......
47 47
        template['NIC']=[template['NIC']].flatten if template['NIC']
48 48
    
49 49
        occi = ERB.new(OCCI_VM)
50
        return occi.result(binding)
50
        return occi.result(binding).gsub(/\n\s*/,'')
51 51

  
52 52
    end
53 53
end
src/cloud/occi/lib/VirtualMachinePoolOCCI.rb
12 12
                  } 
13 13
              end %>
14 14
        </COMPUTES>       
15
    }.gsub(/^        /, '')               
15
    }
16 16
    
17 17
    
18 18
    # Creates the OCCI representation of a Virtual Machine Pool
......
20 20
       pool_hash=to_hash
21 21
       
22 22
       occi = ERB.new(OCCI_VM_POOL)
23
       return occi.result(binding)
23
       return occi.result(binding).gsub(/\n\s*/,'')
24 24
    end
25 25
end
26 26

  
src/cloud/occi/lib/VirtualNetworkOCCI.rb
27 27
            <ADDRESS><%= vn_hash['VNET']['TEMPLATE']['NETWORK_ADDRESS'].strip %></ADDRESS>
28 28
            <SIZE><%= vn_hash['VNET']['TEMPLATE']['NETWORK_SIZE'].strip %></SIZE>
29 29
        </NETWORK>
30
    }.gsub(/^        /, '')
30
    }
31 31

  
32 32
    ONE_NETWORK = %q{
33 33
        NAME            = <%= network_hash['NAME'] %>
......
42 42
        vn_hash = to_hash
43 43

  
44 44
        occi = ERB.new(OCCI_NETWORK)
45
        return occi.result(binding)
45
        return occi.result(binding).gsub(/\n\s*/,'')
46 46
    end
47 47
    
48 48
    def to_one_template(network_hash, bridge)
src/cloud/occi/lib/VirtualNetworkPoolOCCI.rb
13 13
                  } 
14 14
              end %>
15 15
        </NETWORKS>       
16
    }.gsub(/^        /, '')
16
    }
17 17
    
18 18
    # Creates the OCCI representation of a Virtual Network
19 19
    def to_occi(base_url)   
20 20
      network_pool_hash=to_hash
21 21
      
22 22
      occi = ERB.new(OCCI_NETWORK_POOL)
23
      return occi.result(binding)
23
      return occi.result(binding).gsub(/\n\s*/,'')
24 24
    end
25 25
end

Also available in: Unified diff