Revision e6a57b0f src/vmm_mad/remotes/lib/vcenter_driver/network.rb

View differences:

src/vmm_mad/remotes/lib/vcenter_driver/network.rb
69 69

  
70 70

  
71 71
    def self.to_one_template(network_name, network_ref, network_type,
72
                             ccr_ref, ccr_name, vcenter_uuid)
72
                             ccr_ref, ccr_name, vcenter_uuid,
73
                             vcenter_instance_name, dc_name)
74

  
73 75
        one_tmp = {}
74
        one_tmp[:name] = "#{network_name} - #{ccr_name}"
76
        network_import_name = "[#{vcenter_instance_name} - #{dc_name}] #{network_name} - #{ccr_name.tr(" ", "_")}"
77
        one_tmp[:name] = network_import_name
75 78
        one_tmp[:bridge] = network_name
76 79
        one_tmp[:type] = network_type
77 80
        one_tmp[:cluster] = ccr_name
78 81
        one_tmp[:vcenter_ccr_ref] = ccr_ref
79
        one_tmp[:one] = to_one(network_name, network_ref, network_type,
80
                             ccr_ref, ccr_name, vcenter_uuid)
82
        one_tmp[:one] = to_one(network_import_name, network_name, network_ref, network_type,
83
                             ccr_ref, vcenter_uuid)
81 84
        return one_tmp
82 85
    end
83 86

  
84
    def self.to_one(network_name, network_ref, network_type,
85
                    ccr_ref, ccr_name, vcenter_uuid)
86
        template = "NAME=\"#{network_name} - #{ccr_name}\"\n"\
87
    def self.to_one(network_import_name, network_name, network_ref, network_type,
88
                    ccr_ref, vcenter_uuid)
89
        template = "NAME=\"#{network_import_name}\"\n"\
87 90
                   "BRIDGE=\"#{network_name}\"\n"\
88 91
                   "VN_MAD=\"dummy\"\n"\
89 92
                   "VCENTER_PORTGROUP_TYPE=\"#{network_type}\"\n"\

Also available in: Unified diff