Hi Hutson<div><br></div><div>Thanks for sharing!!! :)</div><div><br></div><div>Cheers<br><br><div class="gmail_quote">On Thu, Dec 22, 2011 at 11:07 PM, Hutson Betts <span dir="ltr"><<a href="mailto:hut101@tamu.edu">hut101@tamu.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">For those who are interested in Host-based VLAN for OpenNebula v3.0,<br>
through the OCCI interface, here is the patch included at the bottom of<br>
this e-mail. This is only a temporary patch meant for those who are,<br>
like me, stuck with v3.0 for a while, but still need that specific<br>
feature. Also, don't forget to include the network.erb file in your OCCI<br>
templates folder. That file can be found at:<br>
<a href="http://dev.opennebula.org/projects/opennebula/repository/revisions/master/changes/src/cloud/occi/etc/templates/network.erb" target="_blank">http://dev.opennebula.org/projects/opennebula/repository/revisions/master/changes/src/cloud/occi/etc/templates/network.erb</a><br>
<br>
Patch:<br>
<br>
diff -u original/OCCIServer.rb modified/OCCIServer.rb<br>
--- original/OCCIServer.rb 2011-12-22 15:54:08.545139919 -0600<br>
+++ modified/OCCIServer.rb 2011-12-22 14:01:15.000000000 -0600<br>
@@ -299,7 +299,7 @@<br>
VirtualNetwork.build_xml,<br>
self.client,<br>
request.body,<br>
- @config[:bridge])<br>
+ @config[:template_location])<br>
<br>
# --- Generate the template and Allocate the new Instance ---<br>
template = network.to_one_template<br>
diff -u original/VirtualNetworkOCCI.rb modified/VirtualNetworkOCCI.rb<br>
--- original/VirtualNetworkOCCI.rb 2011-12-22 15:54:20.765139120 -0600<br>
+++ modified/VirtualNetworkOCCI.rb 2011-12-22 14:01:54.000000000 -0600<br>
@@ -51,10 +51,10 @@<br>
}.gsub(/^ /, '')<br>
<br>
# Class constructor<br>
- def initialize(xml, client, xml_info=nil, bridge=nil)<br>
+ def initialize(xml, client, xml_info=nil, base=nil)<br>
super(xml, client)<br>
- @bridge = bridge<br>
@vnet_info = nil<br>
+ @common_template = base + '/network.erb' if base<br>
<br>
if xml_info != nil<br>
xmldoc = XMLElement.build_xml(xml_info, 'NETWORK')<br>
@@ -82,7 +82,13 @@<br>
return error<br>
end<br>
<br>
- one = ERB.new(ONE_NETWORK)<br>
- return one.result(binding)<br>
+ begin<br>
+ template = ERB.new(File.read(@common_template)).result(binding)<br>
+ rescue Exception => e<br>
+ error = OpenNebula::Error.new(e.message)<br>
+ return error<br>
+ end<br>
+<br>
+ return template<br>
end<br>
end<br>
<span class="HOEnZb"><font color="#888888">--<br>
Hutson Betts<br>
Computer Science and Engineering<br>
Texas A&M University<br>
<br>
<br>
</font></span><br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opennebula.org">Users@lists.opennebula.org</a><br>
<a href="http://lists.opennebula.org/listinfo.cgi/users-opennebula.org" target="_blank">http://lists.opennebula.org/listinfo.cgi/users-opennebula.org</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Ruben S. Montero, PhD<br>Project co-Lead and Chief Architect<br>OpenNebula - The Open Source Toolkit for Data Center Virtualization<br><a href="http://www.OpenNebula.org" target="_blank">www.OpenNebula.org</a> | <a href="mailto:rsmontero@opennebula.org" target="_blank">rsmontero@opennebula.org</a> | @OpenNebula<br>
</div>