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

Do not raise an internal error in installation when updating /etc/hosts #512

Merged
merged 10 commits into from
May 18, 2017

Conversation

mchf
Copy link
Member

@mchf mchf commented May 17, 2017

mchf added 3 commits May 17, 2017 11:46
This issue was a regression. The Host#Updated used to accept an array of
static IPs in the past. This feature / API was dropped during
refactoring. However, ResolveHostnameToStaticIPs still used the old API.
@coveralls
Copy link

Coverage Status

Coverage increased (+0.05%) to 29.682% when pulling 7d04e89 on mchf:bnc1038521-host into dbcd315 on yast:master.


fqhostname = Hostname.MergeFQ(DNS.hostname, DNS.domain)

static_ips.reject(&:empty?).each { |sip| Update(fqhostname, fqhostname, sip) }
Copy link
Member

Choose a reason for hiding this comment

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

StaticIPs is defined in this file and this method is the only user. My conclusion is to instead fix that method not to return invalid data in the first place.

Copy link
Member

Choose a reason for hiding this comment

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

OK, and now we no longer need :empty here!

@mvidner
Copy link
Member

mvidner commented May 17, 2017

This issue was a regression. The Host#Updated used to accept an array of
static IPs in the past. This feature / API was dropped during
refactoring. However, ResolveHostnameToStaticIPs still used the old API.

Regarding this I found a comment in the original refactoring PR (#454 (comment))

I have a suspicion that with the refactoring of Host.Update we have broken something. I will do some manual tests and report back.

It turns out the manual tests were not enough. Apparently we did have coveralls set up back then but it did not report in the PR. Even in this PR it does not report. I need to check this.

And, static type checking would have caught this too.

Cc @jreidinger

@jreidinger
Copy link
Member

I will check coveralls

@jreidinger
Copy link
Member

@mvidner in fact it is configured and reported also here. What exactly you missing?

@mvidner
Copy link
Member

mvidner commented May 17, 2017

Duh, the coverage report was there and it is still there! I was looking in the wrong place (the check+cross marks) but it is a regular comment. Sorry for the noise.

@mchf
Copy link
Member Author

mchf commented May 17, 2017

I have a suspicion that with the refactoring of Host.Update we have broken something. I will do some manual tests and report back.

It turns out the manual tests were not enough. Apparently we did have coveralls set up back then but it did not report in the PR. Even in this PR it does not report. I need to check this.

And, static type checking would have caught this too.

yes, I obviously did manual tests wrong or incomplete :-/

@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 29.746% when pulling 203b8cc on mchf:bnc1038521-host into dbcd315 on yast:master.

Copy link
Member

@mvidner mvidner left a comment

Choose a reason for hiding this comment

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

BTW I was wondering how the empty static IPs appeared. The y2log told me: "STARTMODE"=>"off". So the changelog description may be misleading


fqhostname = Hostname.MergeFQ(DNS.hostname, DNS.domain)

static_ips.reject(&:empty?).each { |sip| Update(fqhostname, fqhostname, sip) }
Copy link
Member

Choose a reason for hiding this comment

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

OK, and now we no longer need :empty here!

@mchf
Copy link
Member Author

mchf commented May 17, 2017

empty ips was not the main / only problem. The problem (also) was that module tried to write multiple IPs for one entry - that caused the issue in the lens.

you can reproduce the issue even this way - boot sp3 installation with "ifcfg=eth0=1.1.1.1 ifcfg=eth1=2.2.2.2 hostname=sles.suse.de" - and you'll get the issue too.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 29.746% when pulling 22d7795 on mchf:bnc1038521-host into dbcd315 on yast:master.

@mchf
Copy link
Member Author

mchf commented May 18, 2017

Thanks for the reviews

@mchf mchf merged commit 48f5f78 into yast:master May 18, 2017
@mchf mchf deleted the bnc1038521-host branch May 18, 2017 07:07
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.

4 participants