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

Builder improvements #823

Merged
merged 12 commits into from Jun 6, 2019
Merged

Builder improvements #823

merged 12 commits into from Jun 6, 2019

Conversation

jreidinger
Copy link
Member

No description provided.

@jreidinger jreidinger changed the base branch from master to network-ng June 4, 2019 08:53

def name_valid_characters
Yast::NetworkInterfaces.ValidCharsIfcfg
end
Copy link
Member Author

Choose a reason for hiding this comment

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

seeing all those method, maybe having object for name makes sense?

Copy link
Member

Choose a reason for hiding this comment

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

I think that this method is not correct. It is used only at one place for validating ifcfg name but it can validate even characters which are not allowed in ifcfg (respectively network device) names - see https://github.com/yast/yast-yast2/blob/master/library/types/src/modules/String.rb#L591 and https://github.com/yast/yast-yast2/blob/master/library/types/src/modules/String.rb#L42
Correct validator is a few lines above - valid_name?

Copy link
Member Author

Choose a reason for hiding this comment

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

so is it bug in ValidCharsIfcfg? I just need to get array with chars that is allowed.

Copy link
Member

Choose a reason for hiding this comment

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

i think so

target_driver = driver
if target_driver.empty?
target_driver = Yast::Ops.get_string(Yast::LanItems.getCurrentItem, ["hwinfo", "module"], "")
end
Copy link
Member

Choose a reason for hiding this comment

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

we have Hwinfo class so we can relax dependency on LanItems here

Hwinfo.new(name).module

(module method is currently missing in the Hwinfo class but it is very easy to add)

@coveralls
Copy link

coveralls commented Jun 5, 2019

Coverage Status

Coverage increased (+0.1%) to 56.156% when pulling 53adbc1 on builder_improvements into 5111e81 on network-ng.

Copy link
Member

@mchf mchf left a comment

Choose a reason for hiding this comment

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

lgtm

@jreidinger jreidinger merged commit 11a2390 into network-ng Jun 6, 2019
@jreidinger jreidinger deleted the builder_improvements branch June 6, 2019 07:30
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