1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-27 14:03:40 +03:00

Change ruby matching to maintain 1.8.x support

(cherry picked from commit 70908f54bbadf2775e5c2292d384d189d7240d12)
This commit is contained in:
Tino Vazquez 2015-10-05 13:06:37 +02:00
parent 542e5cf8ea
commit 673bac57f0

View File

@ -339,7 +339,7 @@ class VIClient
# Do not reimport VMs deployed by OpenNebula
# since the core will get confused with the IDs
next if vi_tmp.vm.name.match(/^one-(?<id>\d*)(-(?<tail>.*))?$/)
next if vi_tmp.vm.name.match(/^one-(\d*)(-(.*))?$/)
container_hostname = vi_tmp.vm.runtime.host.parent.name
@ -713,8 +713,8 @@ class VCenterHost < ::OpenNebula::Host
name = v.name
number = -1
matches = name.match(/^one-(?<id>\d*)(-(?<tail>.*))?$/)
number = matches[:id] if matches
matches = name.match(/^one-(\d*)(-(.*))?$/)
number = matches[1] if matches
vm = VCenterVm.new(@client, v)
vm.monitor