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

[V2V] Set default address for conversion host #18577

Closed
wants to merge 2 commits into from
Closed

[V2V] Set default address for conversion host #18577

wants to merge 2 commits into from

Conversation

djberg96
Copy link
Contributor

@djberg96 djberg96 commented Mar 20, 2019

Something of a followup to #18516, this again is based on feedback from the V2V team where it was decided that the address should default to the first IP address of the associated resource. There was already an internal ipaddress method, so we just use that.

Since the UI doesn't (currently) allow users to specify an IP, attempts to connect to the conversion host will fail without this atm.

https://bugzilla.redhat.com/show_bug.cgi?id=1622728

@djberg96
Copy link
Contributor Author

djberg96 commented Mar 20, 2019

@miq-bot bot add_label refactoring, transformation, hammer/yes

@djberg96 djberg96 changed the title Set default address for conversion host [V2V] Set default address for conversion host Mar 20, 2019
@miq-bot

This comment has been minimized.

@djberg96
Copy link
Contributor Author

@miq-bot add_reviewer @agrare

@miq-bot miq-bot requested a review from agrare March 20, 2019 18:25
@miq-bot

This comment has been minimized.

@djberg96
Copy link
Contributor Author

@miq-bot add_label transformation, refactoring, hammer/yes

@agrare agrare self-assigned this Mar 21, 2019
@miq-bot
Copy link
Member

miq-bot commented Mar 21, 2019

Checked commits https://github.com/djberg96/manageiq/compare/383212bebfd681102cc200cb9dfe4f52d755d1c4~...70d4b72121dea7b8b2f13ba3eda7a037d696f4a0 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
2 files checked, 1 offense detected

app/models/conversion_host.rb

@agrare
Copy link
Member

agrare commented Mar 29, 2019

@djberg96 the point of conversion_host.address was for an external conversion host (e.g. installed on a physical machine) where there isn't a linked resource.

I don't like auto-setting this from the underlying resource because it will never change if the host/vm ip address changes. And since it will try self.address first in def ipaddresses it will always return the old address.

Why set a default value here at all?

# Set the default address to the first IP address associated with the resource.
#
def default_address
self.address ||= self.ipaddress
Copy link
Member

Choose a reason for hiding this comment

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

I'm going to NAK based on this, we should be able to handle address not being set and this will break if the vm/host ipaddress changes.

Copy link
Contributor Author

@djberg96 djberg96 Mar 29, 2019

Choose a reason for hiding this comment

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

I guess the thing to do then is to not make the ipaddress address field mandatory, though it makes me wonder why we have it at all then.

Copy link
Member

Choose a reason for hiding this comment

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

Why we have which field? :address?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. Seems like it should just be a virtual attribute. But, whatever, that's neither here nor there for now I suppose.

@djberg96
Copy link
Contributor Author

Why set a default value here at all?

Well, originally it was because of the validation that it had to be present if the underlying resource had at least one ipaddress. But, since the UI doesn't let you set an IP it became a bit problematic.

@djberg96
Copy link
Contributor Author

Closing in favor of #18610

@djberg96 djberg96 closed this Mar 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants