1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-02-10 13:57:22 +03:00

Update PUBLIC parameter in OCCI objects

This commit is contained in:
Daniel Molina 2012-01-11 18:35:41 +01:00
parent 9b9aed19f9
commit 186fc14c12
2 changed files with 14 additions and 2 deletions

View File

@ -33,7 +33,7 @@ class ImageOCCI < Image
<% if self['FSTYPE'] != nil and !self['FSTYPE'].empty? %>
<FSTYPE><%= self['FSTYPE'] %></FSTYPE>
<% end %>
<PUBLIC><%= self['PUBLIC'] == "0" ? "NO" : "YES"%></PUBLIC>
<PUBLIC><%= pub %></PUBLIC>
<PERSISTENT><%= self['PERSISTENT'] == "0" ? "NO" : "YES"%></PERSISTENT>
</STORAGE>
}
@ -82,6 +82,12 @@ class ImageOCCI < Image
# Creates the OCCI representation of an Image
def to_occi(base_url)
if self['PERMISSIONS/GROUP_U'] == "1" || self['PERMISSIONS/OTHER_U'] == "1"
pub = "YES"
else
pub = "NO"
end
begin
occi_im = ERB.new(OCCI_IMAGE)
occi_im_text = occi_im.result(binding)

View File

@ -34,7 +34,7 @@ class VirtualNetworkOCCI < VirtualNetwork
<SIZE><%= network_size %></SIZE>
<% end %>
<USED_LEASES><%= self['TOTAL_LEASES'] %></USED_LEASES>
<PUBLIC><%= self['PUBLIC'] == "0" ? "NO" : "YES"%></PUBLIC>
<PUBLIC><%= pub %></PUBLIC>
</NETWORK>
}
@ -65,6 +65,12 @@ class VirtualNetworkOCCI < VirtualNetwork
network_size = ip_end.to_i - ip_start.to_i
end
if self['PERMISSIONS/GROUP_U'] == "1" || self['PERMISSIONS/OTHER_U'] == "1"
pub = "YES"
else
pub = "NO"
end
begin
occi = ERB.new(OCCI_NETWORK)
occi_text = occi.result(binding)