feature #3848: Remove VN_MAD from cli & sunstone

This commit is contained in:
Ruben S. Montero committed 2016-04-07 12:49:48 +02:00
1 parent bb52452bac
commit 820b0d16fd
8 files changed
+8 -60

No files matched your search

+2 -2
View File
@@ -270,7 +270,7 @@ public:
HostAllocate():
RequestManagerAllocate("HostAllocate",
"Allocates a new host",
"A:sssssi",
"A:ssssi",
false)
{
Nebula& nd = Nebula::instance();
@@ -291,7 +291,7 @@ public:
int get_cluster_id(xmlrpc_c::paramList const& paramList)
{
return RequestManagerAllocate::get_cluster_id(paramList, 5);
return RequestManagerAllocate::get_cluster_id(paramList, 4);
};
int add_to_cluster(
-1
View File
@@ -378,7 +378,6 @@ class OneHostHelper < OpenNebulaHelper::OneHelper
puts str % ["STATE", host.state_str]
puts str % ["IM_MAD", host['IM_MAD']]
puts str % ["VM_MAD", host['VM_MAD']]
puts str % ["VN_MAD", host['VN_MAD']]
puts str % ["LAST MONITORING TIME", OpenNebulaHelper.time_to_str(host['LAST_MON_TIME'])]
puts
+2 -12
View File
@@ -65,14 +65,6 @@ cmd=CommandParser::CmdParser.new(ARGV) do
:format => String
}
VNET = {
:name => "net",
:short => "-n vnet_mad",
:large => "--net vnet_mad" ,
:description => "Set the network driver for the host",
:format => String
}
FORCE = {
:name => "force",
:large => "--force" ,
@@ -87,7 +79,7 @@ cmd=CommandParser::CmdParser.new(ARGV) do
" rsync command must be installed in the frontend and nodes."
}
CREAT_OPTIONS = [ IM, VMM, VNET, OneClusterHelper::CLUSTER ]
CREAT_OPTIONS = [ IM, VMM, OneClusterHelper::CLUSTER ]
SYNC_OPTIONS = [ OneClusterHelper::CLUSTER, FORCE, RSYNC ]
########################################################################
@@ -111,11 +103,10 @@ cmd=CommandParser::CmdParser.new(ARGV) do
EOT
command :create, create_desc, :hostname, :options=>CREAT_OPTIONS do
if options[:im].nil? or options[:vm].nil? or options[:net].nil?
if options[:im].nil? || options[:vm].nil?
STDERR.puts "Drivers are mandatory to create a host:"
STDERR.puts "\t -i information driver"
STDERR.puts "\t -v hypervisor driver"
STDERR.puts "\t -n network driver"
exit -1
end
@@ -125,7 +116,6 @@ cmd=CommandParser::CmdParser.new(ARGV) do
host.allocate(args[0],
options[:im],
options[:vm],
options[:net],
cid)
end
end
+2 -3
View File
@@ -89,13 +89,12 @@ module OpenNebula
# @param hostname [String] Name of the new Host.
# @param im [String] Name of the im_driver (information/monitoring)
# @param vmm [String] Name of the vmm_driver (hypervisor)
# @param vnm [String] Name of the vnm_driver (networking)
# @param cluster_id [String] Id of the cluster, -1 to use default
#
# @return [Integer, OpenNebula::Error] the new ID in case of
# success, error otherwise
def allocate(hostname,im,vmm,vnm,cluster_id=ClusterPool::NONE_CLUSTER_ID)
super(HOST_METHODS[:allocate],hostname,im,vmm,vnm,cluster_id)
def allocate(hostname, im, vmm, cluster_id=ClusterPool::NONE_CLUSTER_ID)
super(HOST_METHODS[:allocate], hostname, im, vmm, cluster_id)
end
# Deletes the Host
@@ -29,7 +29,6 @@ module OpenNebulaJSON
self.allocate(host_hash['name'],
host_hash['im_mad'],
host_hash['vm_mad'],
host_hash['vnm_mad'],
host_hash['cluster_id'].to_i)
end
@@ -117,19 +117,16 @@ define(function(require) {
if (this.value == "custom") {
$(".vcenter_credentials", context).hide();
$("#vnm_mads", context).show();
$("#name_container", context).show();
Sunstone.showFormPanelSubmit(TAB_ID);
$(".drivers", context).show();
} else if (this.value == "vcenter") {
$("#vnm_mads", context).hide();
$("#name_container", context).hide();
$(".vcenter_credentials", context).show();
Sunstone.hideFormPanelSubmit(TAB_ID);
$(".drivers", context).hide();
} else {
$(".vcenter_credentials", context).hide();
$("#vnm_mads", context).show();
$("#name_container", context).show();
Sunstone.showFormPanelSubmit(TAB_ID);
$(".drivers", context).hide();
@@ -190,9 +187,8 @@ define(function(require) {
});
// Show custom driver input only when custom is selected in selects
$('input[name="custom_vmm_mad"],' +
'input[name="custom_im_mad"],' +
'input[name="custom_vnm_mad"]', context).parent().hide();
$('input[name="custom_vmm_mad"],' + 'input[name="custom_im_mad"]',
context).parent().hide();
$('select#vmm_mad', context).change(function() {
if ($(this).val() == "custom")
@@ -208,13 +204,6 @@ define(function(require) {
$('input[name="custom_im_mad"]').parent().hide();
});
$('select#vnm_mad', context).change(function() {
if ($(this).val() == "custom")
$('input[name="custom_vnm_mad"]').parent().show();
else
$('input[name="custom_vnm_mad"]').parent().hide();
});
$('#create_host_form').on("keyup keypress", function(e) {
var code = e.keyCode || e.which;
if (code == 13) {
@@ -242,14 +231,11 @@ define(function(require) {
vmm_mad = vmm_mad == "custom" ? $('input[name="custom_vmm_mad"]').val() : vmm_mad;
var im_mad = $('select#im_mad', context).val();
im_mad = im_mad == "custom" ? $('input[name="custom_im_mad"]').val() : im_mad;
var vnm_mad = $('select#vnm_mad', context).val();
vnm_mad = vnm_mad == "custom" ? $('input[name="custom_vnm_mad"]').val() : vnm_mad;
var host_json = {
"host": {
"name": name,
"vm_mad": vmm_mad,
"vnm_mad": vnm_mad,
"im_mad": im_mad,
"cluster_id": cluster_id
}
@@ -35,26 +35,6 @@
<label for="name">{{tr "Hostname"}}</label>
<input type="text" name="name" id="name" />
</div>
<div class="medium-6 columns">
<div class="manager clear row" id="vnm_mads">
<div class="medium-12 columns">
<label for="vn">{{tr "Networking"}}</label>
<select id="vnm_mad" name="vn">
<option value="dummy">{{tr "Default (dummy)"}}</option>
<option value="fw">{{tr "Firewall"}}</option>
<option value="802.1Q">{{tr "802.1Q"}}</option>
<option value="vxlan">{{tr "VXLAN"}}</option>
<option value="ebtables">{{tr "ebtables"}}</option>
<option value="ovswitch">{{tr "Open vSwitch"}}</option>
<option value="custom">{{tr "Custom"}}</option>
</select>
</div>
<div class="large-12 columns">
<label>{{tr "Custom VNM_MAD"}}</label>
<input type="text" name="custom_vnm_mad" />
</div>
</div>
</div>
</div>
<div class="drivers">
<fieldset>
@@ -44,11 +44,6 @@
<td class="value_td">{{element.VM_MAD}}</td>
<td></td>
</tr>
<tr>
<td class="key_td">{{tr "VN MAD"}}</td>
<td class="value_td">{{element.VN_MAD}}</td>
<td></td>
</tr>
</tbody>
</table>
</div>