Revision e1f51ba7

View differences:

src/vmm_mad/remotes/lib/vcenter_driver/importer.rb
524 524
                ar_type="e"
525 525
                first_ip=nil
526 526
                first_mac=nil
527
                slaac=nil
527 528
                global_prefix=nil
528 529
                ula_prefix=nil
530
                ip6_address = nil
531
                prefix_length = nil
529 532

  
530 533
                # Size
531 534
                if !use_defaults
......
568 571
                        mac_answer = STDIN.gets.strip
569 572
                        first_mac = first_mac_answer if !mac_answer.empty?
570 573

  
571
                        STDOUT.print "    Please input the GLOBAL PREFIX "\
572
                                        "[Enter for default]: "
573
                        gp_answer = STDIN.gets.strip
574
                        global_prefix = gp_answer if !gp_answer.empty?
574
                        STDOUT.print "    Do you want to use SLAAC "\
575
                                     "Stateless Address Autoconfiguration? ([y]/n): "
576
                        slaac_answer = STDIN.gets.strip.strip.downcase
577

  
578
                        if slaac_answer == 'n'
579
                            slaac = false
580
                            STDOUT.print "    Please input the IPv6 address (cannot be empty): "
581
                            ip6_address = STDIN.gets.strip
582
                            ip6_address = ip6_address if !ip6_address.empty?
575 583

  
576
                        STDOUT.print "    Please input the ULA PREFIX "\
584
                            STDOUT.print "    Please input the Prefix length (cannot be empty): "
585
                            prefix_length = STDIN.gets.strip
586
                            prefix_length = prefix_length if !prefix_length.empty?
587
                        else
588
                            slaac = true
589
                            STDOUT.print "    Please input the GLOBAL PREFIX "\
577 590
                                        "[Enter for default]: "
578
                        ula_answer = STDIN.gets.strip
579
                        ula_prefix = ula_answer if !ula_answer.empty?
591
                            gp_answer = STDIN.gets.strip
592
                            global_prefix = gp_answer if !gp_answer.empty?
593

  
594
                            STDOUT.print "    Please input the ULA PREFIX "\
595
                                            "[Enter for default]: "
596
                            ula_answer = STDIN.gets.strip
597
                            ula_prefix = ula_answer if !ula_answer.empty?
598
                        end
580 599
                    when "e"
581 600
                        STDOUT.print "    Please input the first MAC "\
582 601
                                "in the range [Enter for default]: "
......
593 612
                    ar_str << ",IP=" + first_ip if first_ip
594 613
                    ar_str << ",MAC=" + first_mac if first_mac
595 614
                when "6"
596
                    ar_str << "IP6\""
597
                    ar_str << ",MAC=" + first_mac if first_mac
598
                    ar_str << ",GLOBAL_PREFIX=" + global_prefix if global_prefix
599
                    ar_str << ",ULA_PREFIX=" + ula_prefix if ula_prefix?
615
                    if slaac
616
                        ar_str << "IP6\""
617
                        ar_str << ",MAC=" + first_mac if first_mac
618
                        ar_str << ",GLOBAL_PREFIX=" + global_prefix if global_prefix
619
                        ar_str << ",ULA_PREFIX=" + ula_prefix if ula_prefix
620
                    else
621
                        ar_str << "IP6_STATIC\""
622
                        ar_str << ",MAC=" + first_mac if first_mac
623
                        ar_str << ",IP6=" + ip6_address if ip6_address
624
                        ar_str << ",PREFIX_LENGTH=" + prefix_length if prefix_length
625
                    end
600 626
                when "e"
601 627
                    ar_str << "ETHER\""
602 628
                    ar_str << ",MAC=" + first_mac if first_mac

Also available in: Unified diff