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

B #5370: Name with | char cannot be imported from vCenter (#1172)

Signed-off-by: Carlos Herrera <cherrera@opennebula.io>
This commit is contained in:
Carlos J. Herrera 2021-04-30 04:27:46 -04:00 committed by GitHub
parent c338b345b3
commit f924fc5f42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View File

@ -418,7 +418,9 @@ class DatacenterFolder
full_process = !args[:short]
vc_network_ref = vc_network._ref
vc_network_name = vc_network.name
vc_network_name = VCenterDriver::VcImporter.sanitize(
vc_network.name
)
vc_network_host = vc_network['host']
vc_network_tag = vc_network['tag']

View File

@ -382,6 +382,14 @@ module VCenterDriver
end
end
def self.sanitize(text)
bad_chars = ['|']
bad_chars.each do |bad_char|
text.gsub!(bad_char, '_')
end
text
end
protected
#