1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-08 20:58:17 +03:00

feature #863: Fix syntax errors

This commit is contained in:
Ruben S. Montero 2011-11-22 13:49:41 +01:00
parent 041e58bbf4
commit 36127a584a
6 changed files with 26 additions and 8 deletions

View File

@ -507,6 +507,9 @@ RUBY_LIB_FILES="src/mad/ruby/ActionManager.rb \
src/mad/ruby/CommandManager.rb \
src/mad/ruby/OpenNebulaDriver.rb \
src/mad/ruby/VirtualMachineDriver.rb \
src/mad/ruby/DriverExecHelper.rb \
src/mad/ruby/ssh_stream.rb \
src/vnm_mad/one_vnm.rb \
src/mad/ruby/Ganglia.rb \
src/oca/ruby/OpenNebula.rb \
src/tm_mad/TMScript.rb \

View File

@ -14,7 +14,6 @@
# limitations under the License. #
#--------------------------------------------------------------------------- #
# This module provides an abstraction to generate an execution context for
# OpenNebula Drivers. The module has been designed to be included as part
# of a driver and not to be used standalone.

View File

@ -17,6 +17,8 @@
require "ActionManager"
require "CommandManager"
require "DriverExecHelper"
# Author:: dsa-research.org
# Copyright:: (c) OpenNebula Project Leads (OpenNebula.org)
# License:: Apache License
@ -101,12 +103,12 @@ class OpenNebulaDriver < ActionManager
params = parameters+" #{id} #{host}"
command = action_command_line(aname, params, options[:script_name])
if options[:local] || action_is_local? aname
if options[:local] || action_is_local?(aname)
execution = LocalCommand.run(command, log_method(id))
elsif options[:ssh_stream]
if options[:stdin]
command = "cat << EOT | #{command}"
stdin = "#{options[:stdin]\nEOT\n}"
stdin = "#{options[:stdin]}\nEOT\n"
else
stdin = nil
end

View File

@ -1,3 +1,18 @@
# -------------------------------------------------------------------------- #
# Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
# not use this file except in compliance with the License. You may obtain #
# a copy of the License at #
# #
# http://www.apache.org/licenses/LICENSE-2.0 #
# #
# Unless required by applicable law or agreed to in writing, software #
# distributed under the License is distributed on an "AS IS" BASIS, #
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
# See the License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
require 'CommandManager'
require 'open3'

View File

@ -1,6 +1,5 @@
#!/usr/bin/env ruby
# -------------------------------------------------------------------------- #
# Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) #
# #
@ -17,7 +16,6 @@
# limitations under the License. #
#--------------------------------------------------------------------------- #
# Set up the environment for the driver
ONE_LOCATION = ENV["ONE_LOCATION"]
@ -33,9 +31,9 @@ end
$: << RUBY_LIB_LOCATION
require "VirtualMachineDriver"
require 'one_vnm'
require 'getoptlong'
require 'ssh_stream'
require 'pp'
# The main class for the Sh driver

View File

@ -14,6 +14,7 @@
# limitations under the License. #
#--------------------------------------------------------------------------- #
require "DriverExecHelper"
# This module provides an abstraction to generate an execution context for
# OpenNebula Drivers
@ -50,12 +51,12 @@ class VirtualNetworkDriver
command = action_command_line(aname, @vm_encoded)
if action_is_local? aname
if action_is_local?(aname)
execution = LocalCommand.run(command, log_method(id))
else
if options[:stdin]
command = "cat << EOT | #{command}"
stdin = "#{options[:stdin]\nEOT\n}"
stdin = "#{options[:stdin]}\nEOT\n"
else
stdin = nil
end