mirror of
https://github.com/OpenNebula/one.git
synced 2025-01-26 10:03:37 +03:00
M #-: Delay vcenter driver requirement
This commit is contained in:
parent
8baad6790e
commit
55ff59774a
@ -15,7 +15,6 @@
|
||||
#--------------------------------------------------------------------------- #
|
||||
|
||||
require 'opennebula/template_ext'
|
||||
require 'vcenter_driver'
|
||||
|
||||
# Module to decorate VirtualMachine class with additional helpers not directly
|
||||
# exposed through the OpenNebula XMLRPC API. The extensions include
|
||||
@ -101,6 +100,11 @@ module OpenNebula::VirtualMachineExt
|
||||
use_linked_clones = self['USER_TEMPLATE/VCENTER_LINKED_CLONES']
|
||||
|
||||
if use_linked_clones && use_linked_clones.downcase == 'yes'
|
||||
# Delay the require until it is strictly needed
|
||||
# This way we can avoid the vcenter driver dependency
|
||||
# in no vCenter deployments
|
||||
require 'vcenter_driver'
|
||||
|
||||
deploy_id = self['DEPLOY_ID']
|
||||
vm_id = self['ID']
|
||||
host_id = self['HISTORY_RECORDS/HISTORY[last()]/HID']
|
||||
|
Loading…
x
Reference in New Issue
Block a user