-
Notifications
You must be signed in to change notification settings - Fork 42
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
Turn Host kwargs into object's attributes every time #213
Turn Host kwargs into object's attributes every time #213
Conversation
from_dict=True
Another approach I can think of is to remove the |
I like your last comment. Additionally, now that hostname and name aren't technically required. We can remove them as named arguments and just take it all in as kwargs. If we go that route though, it would be good to add a docstring telling people which combination of arguments are required. |
Should I review this version or are we changing the PR? @ogajduse |
@Griffin-Sullivan @JacobCallahan Implemented. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ran some functional tests and used ipython to make sure host creation works with hostname and IP and doesn't work when missing either. I also verified that changing the hostname and IP to null
before checkin doesn't throw an error once the checkin completes.
f0736b0
to
f22f7ee
Compare
from_dict=True
f22f7ee
to
c9ff479
Compare
Let's have the following host
Then the following code snippet
will fail with
AttributeError: 'IPAHost' object has no attribute 'hostname'
The
Host
__init__
stores thehostname
and thename
in args, not inkwargs
. So we need to setname
andhostname
directly regardless of whatfrom_dict
is set to.Ref: SatelliteQE/robottelo#11445
This is most likely the first host that is using
from_dict
. 😏