Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set more connection config attributes #898

Merged
merged 2 commits into from
Jul 24, 2019

Conversation

jreidinger
Copy link
Member

No description provided.

@coveralls
Copy link

coveralls commented Jul 24, 2019

Coverage Status

Coverage increased (+0.07%) to 63.535% when pulling 92efab0 on connection_config_in_builder into f7101ca on network-ng.

Copy link
Contributor

@imobachgs imobachgs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general it looks good. We could improve connection configs API to simpify this code.

@@ -58,12 +60,17 @@ def self.for(type)
#
# Load with reasonable defaults
# @param type [Y2Network::InterfaceType] type of device
def initialize(type:)
# @param config [Y2Network::ConnectionConfig::Base] existing configuration of device or nil for
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

np: Just add the , nil there.


# connection config
# keep only default as aliases does not handle default ip config
@connection_config.ip_configs.delete_if { |c| c.id != "" }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could add ConnectionConfig::Base#main_ip_config and ConnectionConfig::Base#aliases (or something like this) so you do not have to worry about this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, when added, feel free to change this code ;)

# in such case remove default config
@connection_config.ip_configs.delete_if { |c| c.id == "" }
else
ip_config_default.address.address = value
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same than above.

@jreidinger jreidinger merged commit 6db2778 into network-ng Jul 24, 2019
@imobachgs imobachgs deleted the connection_config_in_builder branch July 24, 2019 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants