1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-22 18:50:08 +03:00

Revert "merge with origin/master"

This reverts commit 5e231696890334871be82d92c966f88e0ddd5a2d.
This commit is contained in:
Javi Fontan 2016-11-14 11:45:15 +01:00
parent be09537a83
commit e2bc33bdf1
19 changed files with 94 additions and 9 deletions

View File

@ -241,7 +241,7 @@ class EC2QueryServer < CloudServer
private
def render_launch_time(vm)
return "<launchTime>#{Time.at(vm["STIME"].to_i).xmlschema}</launchTime>"
return "<launchTime>#{Time.at(vm["STIME"].to_i).utc.xmlschema}</launchTime>"
end
end

View File

@ -64,7 +64,13 @@ ARGV.each do |xpath|
values << ar.join(' ')
else
element = xml.elements[xpath.dup]
values << element.text.to_s if !element.nil?
if !element.nil?
if element.class.method_defined?(:text)
values << element.text
else
values << element.to_s
end
end
end
values << "\0"
end

View File

@ -2637,7 +2637,7 @@ EOT
# Params:
# +disk+:: Nokogiri::XML::Node describing a disk used by a template
def get_image_from_name(disk)
name = disk.at_xpath("IMAGE").content # always defined
name = disk.at_xpath("IMAGE") && disk.at_xpath("IMAGE").content
uid = disk.at_xpath("IMAGE_UID")
uname = disk.at_xpath("IMAGE_UNAME")

View File

@ -1,5 +1,6 @@
small_logo: images/opennebula-5.0.png
provision_logo: images/opennebula-5.0.png
confirm_vms: true
enabled_tabs:
- dashboard-tab
- instances-top-tab

View File

@ -1,4 +1,5 @@
provision_logo: images/opennebula-5.0.png
confirm_vms: true
enabled_tabs:
- provision-tab
- settings-tab

View File

@ -1,5 +1,6 @@
small_logo: images/opennebula-5.0.png
provision_logo: images/opennebula-5.0.png
confirm_vms: true
enabled_tabs:
- dashboard-tab
- instances-top-tab

View File

@ -146,10 +146,15 @@ define(function(require) {
'vmLogos': (_config['vm_logos']),
'enabledTabs': _config['view']['enabled_tabs'],
'onedConf': _config['oned_conf'],
'confirmVMActions': _config['view']['confirm_vms'],
"allTabs": function() {
return Object.keys(_config['view']['tabs']);
}
/*"isConfirmVmsActionsEnable": function() {
Console.Log(_config['view']['confirm_vms']);
}*/
}
return Config;

View File

@ -77,6 +77,8 @@ define(function(require) {
var hostnameHTML = OpenNebula.VM.hostnameStrLink(this.element);
var vrouterHTML = '--';
var IP = OpenNebula.VM.ipsStr(this.element);
if (this.element.TEMPLATE.VROUTER_ID != undefined){
vrouterHTML = Navigation.link(
OpenNebula.VirtualRouter.getName(this.element.TEMPLATE.VROUTER_ID),
@ -122,6 +124,7 @@ define(function(require) {
'hostnameHTML': hostnameHTML,
'prettyStartTime': prettyStartTime,
'deployId': deployId,
'IP': IP,
'resched': resched,
'permissionsTableHTML': permissionsTableHTML,
'templateTableHTML': templateTableHTML,
@ -133,7 +136,6 @@ define(function(require) {
function _setup(context) {
RenameTr.setup(TAB_ID, RESOURCE, this.element.ID, context);
PermissionsTable.setup(TAB_ID, RESOURCE, this.element, context);
// Get rid of the unwanted (for show) SCHED_* keys
var that = this;
var strippedTemplate = {};

View File

@ -43,6 +43,13 @@
<td class="value_td">{{{hostnameHTML}}}</td>
<td></td>
</tr>
<tr>
<td class="key_td">{{tr "IP"}}</td>
<td class="value_td">{{{IP}}}</td>
<td></td>
</tr>
<tr>
<td class="key_td">{{tr "Start time"}}</td>
<td class="value_td">{{prettyStartTime}}</td>

View File

@ -130,6 +130,7 @@ define(function(require) {
];
}
function _emptyElementArray(vmId) {
return [
'<input class="check_item" type="checkbox" id="' + RESOURCE.toLowerCase() + '_' +

View File

@ -2,6 +2,7 @@
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>OpenNebula Sunstone: Cloud Operations Center</title>
@ -60,6 +61,7 @@
<link href="css/app.css?v=<%= OpenNebula::VERSION %>" media="screen, projector, print" rel="stylesheet" type="text/css"></link>
<% else %>
<link href="css/app.min.css?v=<%= OpenNebula::VERSION %>" media="screen, projector, print" rel="stylesheet" type="text/css"></link>
<% end %>
</head>
<body class="antialiased">

View File

@ -1,7 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>OpenNebula Sunstone Login</title>
<!--[if IE]><link rel="shortcut icon" href="images/favicon.ico"><![endif]-->

View File

@ -25,8 +25,8 @@
# - template is the template of the VM in XML and base64 encoded
# - system_ds_mad flag if called by other SYSTEM_DS TM_MAD
SRC="$1"
DST="$2"
SRC_HOST="$1"
DST_HOST="$2"
DST_PATH="$3"
VM_ID="$4"
DS_ID="$5"

View File

@ -2651,8 +2651,7 @@ private
vm.config.hardware.device.each{ |dv|
if is_nic?(dv)
nics.each{|nic|
if nic.elements["MAC"].text == dv.macAddress and
nic.elements["BRIDGE"].text == dv.deviceInfo.summary
if nic.elements["MAC"].text == dv.macAddress
nics.delete(nic)
end
}

View File

@ -51,4 +51,17 @@ class VLANTagDriver < VNMMAD::VLANDriver
OpenNebula.exec_and_log("#{command(:ip)} link set #{@nic[:vlan_dev]} up")
end
def get_interface_vlan(name)
text = %x(#{command(:ip)} -d link show #{name})
return nil if $?.exitstatus != 0
text.each_line do |line|
m = line.match(/vlan protocol 802.1Q id (\d+)/)
return m[1] if m
end
nil
end
end

View File

@ -14,6 +14,10 @@
# limitations under the License. #
#--------------------------------------------------------------------------- #
# Set to true to check that no other vlans are connected to the bridge.
# Works with 802.1Q and VXLAN.
:validate_vlan_id: false
################################################################################
# Open vSwitch Options
################################################################################

View File

@ -46,6 +46,9 @@ module VNMMAD
# Create the bridge.
create_bridge
# Check that no other vlans are connected to this bridge
validate_vlan_id
# Return if vlan device is already in the bridge.
next if @bridges[@nic[:bridge]].include? @nic[:vlan_dev]
@ -91,6 +94,9 @@ module VNMMAD
# Get the name of the vlan device.
get_vlan_dev_name
# Return if the bridge doesn't exist because it was already deleted (handles last vm with multiple nics on the same vlan)
next if !@bridges.include? @nic[:bridge]
# Return if the vlan device is not the only left device in the bridge.
next if @bridges[@nic[:bridge]].length > 1 or !@bridges[@nic[:bridge]].include? @nic[:vlan_dev]
@ -149,5 +155,27 @@ module VNMMAD
bridges
end
def get_interface_vlan(name)
nil
end
def validate_vlan_id
@bridges[@nic[:bridge]].each do |interface|
vlan = get_interface_vlan(interface)
if vlan && vlan.to_s != @nic[:vlan_id]
OpenNebula.log_error("The interface #{interface} has "\
"vlan_id = #{vlan} but the network is configured "\
"with vlan_id = #{@nic[:vlan_id]}")
msg = "Interface with an incorrect vlan_id is already in "\
"the bridge"
OpenNebula.error_message(msg)
exit(-1)
end
end
end
end
end

View File

@ -32,7 +32,7 @@ require 'sg_driver'
require 'vlan'
require 'scripts_common'
Dir["vnmmad-load.d/*.rb"].each{ |f| require f }
Dir[File.expand_path('vnmmad-load.d', File.dirname(__FILE__)) + "/*.rb"].each{ |f| require f }
include OpenNebula

View File

@ -54,4 +54,17 @@ class VXLANDriver < VNMMAD::VLANDriver
OpenNebula.exec_and_log("#{command(:ip)} link set #{@nic[:vlan_dev]} up")
end
def get_interface_vlan(name)
text = %x(#{command(:ip)} -d link show #{name})
return nil if $?.exitstatus != 0
text.each_line do |line|
m = line.match(/^\s*vxlan id (\d+)/)
return m[1] if m
end
nil
end
end