mirror of
https://github.com/OpenNebula/one.git
synced 2025-04-01 06:50:25 +03:00
bug #4724: move VM Driver constants to oca
This commit is contained in:
parent
ee626f6fcb
commit
c2b7864a4f
@ -13,6 +13,7 @@
|
||||
# See the License for the specific language governing permissions and #
|
||||
# limitations under the License. #
|
||||
#--------------------------------------------------------------------------- #
|
||||
require 'opennebula'
|
||||
require "OpenNebulaDriver"
|
||||
require "CommandManager"
|
||||
require 'base64'
|
||||
@ -52,23 +53,8 @@ class VirtualMachineDriver < OpenNebulaDriver
|
||||
:update_sg => "UPDATESG"
|
||||
}
|
||||
|
||||
POLL_ATTRIBUTE = {
|
||||
:memory => "MEMORY",
|
||||
:cpu => "CPU",
|
||||
:nettx => "NETTX",
|
||||
:netrx => "NETRX",
|
||||
:state => "STATE",
|
||||
:disk_size => "DISK_SIZE",
|
||||
:snapshot_size => "SNAPSHOT_SIZE"
|
||||
}
|
||||
|
||||
VM_STATE = {
|
||||
:active => 'a',
|
||||
:paused => 'p',
|
||||
:error => 'e',
|
||||
:deleted => 'd',
|
||||
:unknown => '-'
|
||||
}
|
||||
POLL_ATTRIBUTE = OpenNebula::VirtualMachine::Driver::POLL_ATTRIBUTE
|
||||
VM_STATE = OpenNebula::VirtualMachine::Driver::VM_STATE
|
||||
|
||||
HOST_ARG = 1
|
||||
|
||||
|
@ -218,6 +218,27 @@ module OpenNebula
|
||||
'SL_PRIMARYIPADDRESS'
|
||||
]
|
||||
|
||||
# VirtualMachineDriver constants
|
||||
module Driver
|
||||
POLL_ATTRIBUTE = {
|
||||
:memory => "MEMORY",
|
||||
:cpu => "CPU",
|
||||
:nettx => "NETTX",
|
||||
:netrx => "NETRX",
|
||||
:state => "STATE",
|
||||
:disk_size => "DISK_SIZE",
|
||||
:snapshot_size => "SNAPSHOT_SIZE"
|
||||
}
|
||||
|
||||
VM_STATE = {
|
||||
:active => 'a',
|
||||
:paused => 'p',
|
||||
:error => 'e',
|
||||
:deleted => 'd',
|
||||
:unknown => '-'
|
||||
}
|
||||
end
|
||||
|
||||
# Creates a VirtualMachine description with just its identifier
|
||||
# this method should be used to create plain VirtualMachine objects.
|
||||
# +id+ the id of the vm
|
||||
|
@ -42,7 +42,6 @@ require 'yaml'
|
||||
require 'opennebula'
|
||||
require 'base64'
|
||||
require 'openssl'
|
||||
require 'VirtualMachineDriver'
|
||||
|
||||
################################################################################
|
||||
# Monkey patch rbvmomi library with some extra functions
|
||||
@ -1361,8 +1360,8 @@ end
|
||||
class VCenterVm
|
||||
attr_reader :vm
|
||||
|
||||
POLL_ATTRIBUTE = VirtualMachineDriver::POLL_ATTRIBUTE
|
||||
VM_STATE = VirtualMachineDriver::VM_STATE
|
||||
POLL_ATTRIBUTE = OpenNebula::VirtualMachine::Driver::POLL_ATTRIBUTE
|
||||
VM_STATE = OpenNebula::VirtualMachine::Driver::VM_STATE
|
||||
|
||||
############################################################################
|
||||
# Creates a new VIVm using a RbVmomi::VirtualMachine object
|
||||
|
Loading…
x
Reference in New Issue
Block a user