Skip to content

Commit

Permalink
Merge 871401b into 6974a90
Browse files Browse the repository at this point in the history
  • Loading branch information
imobachgs committed Aug 1, 2019
2 parents 6974a90 + 871401b commit 21bd9aa
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
20 changes: 13 additions & 7 deletions src/lib/y2network/interface_config_builder.rb
Expand Up @@ -256,9 +256,9 @@ def aliases

new_aliases = @connection_config.ip_aliases.map do |data|
{
label: data.label,
ip: data.address.address,
prefixlen: data.address.prefix
label: data.label.to_s,
ip: data.address.address.to_s,
prefixlen: data.address.prefix.to_s,
# NOTE: new API does not have netmask at all, we need to adapt UI to clearly mention only prefix
}
end
Expand Down Expand Up @@ -294,7 +294,7 @@ def ip_address

default = @connection_config.ip
new_ = if default
default.address.address
default.address.address.to_s
else
""
end
Expand Down Expand Up @@ -563,10 +563,16 @@ def ip_config_default
# method that allows easy change of backend for providing data
# it also logs error if result differs
# TODO: Only temporary method for testing switch of backends. Remove it from production
def select_backend(old, new)
log.error "Different value in backends. Old: #{old.inspect} New: #{new.inspect}" if new != old
#
# @param old_value [Object]
# @param new_value [Object]
def select_backend(old_value, new_value)
if new_value != old_value
log.error "Different value in backends. Old: #{old_value.inspect} New: #{new_value.inspect}"
end

old
# XXX: to be removed when fully migrated to the new backend
ENV["Y2NETWORK_NEW_BACKEND"] == "1" ? new_value : old_value
end

# Returns the connection config class for a given type
Expand Down
2 changes: 1 addition & 1 deletion src/lib/y2network/sysconfig/interface_file.rb
Expand Up @@ -154,7 +154,7 @@ def variable_name(param_name)

# !@attribute [r] labels
# @return [Hash] Label to assign to the address
define_collection_variable(:label, :symbol)
define_collection_variable(:label, :string)

# !@attribute [r] remote_ipaddrs
# @return [Hash] Remote IP address of a point to point connection
Expand Down

0 comments on commit 21bd9aa

Please sign in to comment.