1
0
mirror of https://github.com/OpenNebula/one.git synced 2024-12-27 03:21:29 +03:00

F #~: fix sanitize when import (#771)

Signed-off-by: Carlos Herrera <cherrera@opennebula.io>
This commit is contained in:
Carlos J. Herrera 2021-02-08 12:48:02 -05:00 committed by GitHub
parent d4d133b882
commit fe166a9bdc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -554,7 +554,7 @@ module VCenterDriver
full_process = !args[:short]
vc_network_ref = vc_network._ref
vc_network_name = VCenterDriver::FileHelper.sanitize(
vc_network_name = VCenterDriver::VcImporter.sanitize(
vc_network.name
)
vc_network_host = vc_network['host']

View File

@ -385,6 +385,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
#