fog-kubevirt 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 445aff4c53478ed34bda932d25161a63a5c3626a
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: e2ad2b37177c59c61f1d57b20c7294f028ccad28
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 7fb2a57dc4d902e140442981ff5aa1f3acd0e6fda538f615f6be12e890eb9b825ed6879a0b4d96abcf9a313ab418aec0396e10c032fc19ad34a5c12f6221c786
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 32866fcaea0020147cb2688993fb3b3050c9b4eebe97945c0aa6ae2683eec6a419543c80f216d7527bb9b7fa9396e0414aa04c85f8552847e4527eed9193e655
         
     | 
| 
         @@ -18,7 +18,7 @@ module Fog 
     | 
|
| 
       18 
18 
     | 
    
         
             
                      object.each do |iface|
         
     | 
| 
       19 
19 
     | 
    
         
             
                        nic = VmNic.new
         
     | 
| 
       20 
20 
     | 
    
         
             
                        nic.name = iface[:name]
         
     | 
| 
       21 
     | 
    
         
            -
                        status_iface = object_status.find { |hash| hash[:name] == iface[:name] }
         
     | 
| 
      
 21 
     | 
    
         
            +
                        status_iface = object_status.find { |hash| hash[:name] == iface[:name] } unless object_status.nil?
         
     | 
| 
       22 
22 
     | 
    
         
             
                        # get mac address from status and use device definition if not available
         
     | 
| 
       23 
23 
     | 
    
         
             
                        nic.mac_address = !status_iface.nil? && status_iface.key?(:mac) ? status_iface[:mac] : iface[:macAddress]
         
     | 
| 
       24 
24 
     | 
    
         
             
                        nic.type = 'bridge' if iface.keys.include?(:bridge)
         
     | 
| 
         @@ -57,7 +57,7 @@ module Fog 
     | 
|
| 
       57 
57 
     | 
    
         
             
                    end
         
     | 
| 
       58 
58 
     | 
    
         | 
| 
       59 
59 
     | 
    
         
             
                    def get_server(name)
         
     | 
| 
       60 
     | 
    
         
            -
                      if name == "robin-rykert.example.com"
         
     | 
| 
      
 60 
     | 
    
         
            +
                      if name == "robin-rykert.example.com" || name == 'no_interfaces'
         
     | 
| 
       61 
61 
     | 
    
         
             
                        disk1 = disk(name: "robin-rykert-example-com-disk-00", boot_order: nil,type: "disk", bus: "virtio", readonly: nil)
         
     | 
| 
       62 
62 
     | 
    
         
             
                        disk2 = disk(name: "robin-rykert-example-com-disk-01", boot_order: nil,type: "disk", bus: "virtio", readonly: nil)
         
     | 
| 
       63 
63 
     | 
    
         | 
| 
         @@ -70,6 +70,8 @@ module Fog 
     | 
|
| 
       70 
70 
     | 
    
         
             
                        vm_network.name="ovs-foreman"
         
     | 
| 
       71 
71 
     | 
    
         
             
                        vm_network.type="multus"
         
     | 
| 
       72 
72 
     | 
    
         | 
| 
      
 73 
     | 
    
         
            +
                        interfaces = name != 'no_interfaces' ? [vm_nic(mac_address: "a2:b4:a2:b6:a2:a8")] : nil
         
     | 
| 
      
 74 
     | 
    
         
            +
             
     | 
| 
       73 
75 
     | 
    
         
             
                        return {
         
     | 
| 
       74 
76 
     | 
    
         
             
                          :namespace=>"default",
         
     | 
| 
       75 
77 
     | 
    
         
             
                          :name=>"robin-rykert.example.com",
         
     | 
| 
         @@ -79,7 +81,7 @@ module Fog 
     | 
|
| 
       79 
81 
     | 
    
         
             
                          :disks=>[disk1, disk2],
         
     | 
| 
       80 
82 
     | 
    
         
             
                          :volumes=>[volume1, volume2],
         
     | 
| 
       81 
83 
     | 
    
         
             
                          :status=>"stopped",
         
     | 
| 
       82 
     | 
    
         
            -
                          :interfaces=> 
     | 
| 
      
 84 
     | 
    
         
            +
                          :interfaces=>interfaces,
         
     | 
| 
       83 
85 
     | 
    
         
             
                          :networks=>[vm_network],
         
     | 
| 
       84 
86 
     | 
    
         
             
                          :machine_type=>"",
         
     | 
| 
       85 
87 
     | 
    
         
             
                          :cpu_cores=>1,
         
     | 
    
        data/lib/fog/kubevirt/version.rb
    CHANGED
    
    
    
        data/spec/vm_parse.rb
    CHANGED
    
    | 
         @@ -14,4 +14,11 @@ describe Fog::Kubevirt::Compute do 
     | 
|
| 
       14 
14 
     | 
    
         
             
                assert_equal(vm[:interfaces][0].mac_address, '0e:fc:6c:c3:20:ec')
         
     | 
| 
       15 
15 
     | 
    
         
             
                assert_equal(vm[:interfaces][1].mac_address, '4a:90:1c:2e:fe:d7')
         
     | 
| 
       16 
16 
     | 
    
         
             
              end
         
     | 
| 
      
 17 
     | 
    
         
            +
             
     | 
| 
      
 18 
     | 
    
         
            +
              it 'parses not ready server' do
         
     | 
| 
      
 19 
     | 
    
         
            +
                mock = Fog::Kubevirt::Compute::Mock.new
         
     | 
| 
      
 20 
     | 
    
         
            +
                server = mock.get_server('no_interfaces')
         
     | 
| 
      
 21 
     | 
    
         
            +
             
     | 
| 
      
 22 
     | 
    
         
            +
                assert_nil(server[:interfaces])
         
     | 
| 
      
 23 
     | 
    
         
            +
              end
         
     | 
| 
       17 
24 
     | 
    
         
             
            end
         
     |