[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Ovirt-devel] [PATCH] Enables the generation of a configuration file for a managed node.



"Darryl L. Pierce" <dpierce redhat com> wrote:
> The configuration is generated from the contents of the nics table. The
> managed node then downloads that configuration after completing the
> identification and applies those changes.
>
> What this needs is integration with the WUI itself, to generate the file
> when the admin modifies the NIC for the host.

Hi Darryl,
I was just glancing through this and
stumbled up on what looks like a bug:

...
> diff --git a/wui/src/host-browser/host-browser.rb b/wui/src/host-browser/host-browser.rb
...
> +    # Update the NIC details for this host:
> +    # -if the NIC exists, then update the IP address
> +    # -if the NIC does not exist, create it
> +    # -any nic not in this list is deleted
>
> -            key, value = info.split("=")
> +    puts "Updating NIC records for the node"
> +    nics = Array.new
>
> -            puts "#{ log_prefix} ::Received - #{key}:#{value}" unless defined?(TESTING)
> -            result[key] = value
> +    host.nics.collect do |nic|
> +      found = false
>
> -            @session.write("ACK #{key}\n")
> +      nic_info.collect do |detail|
> +        # if we have a match, then update the database and remove
> +        # the received data to avoid creating a dupe later
> +        if detail['MAC'] == nic.mac
> +          nic_info.delete(detail)

I think you want to insert "found = true" here.

>          end
> +      end
>
> -        @session.write("ACK NIC\n");
> -
> -        return result
> +      # if the record wasn't found, then remove it from the database
> +      unless found
> +        host.nics.delete(nic)
> +        nic.destroy
> +      end
>      end


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]