-
Notifications
You must be signed in to change notification settings - Fork 458
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
enable dhcp as optional parameter (typelist) #385
Conversation
e65f5ac
to
6bde519
Compare
4c7ccfa
to
68e90bb
Compare
68e90bb
to
bf1c495
Compare
produces:
so you get
|
@MalloZup just pick the fixes to the crash mentioned above from my own PR, it boils down to adding two tests:
I think it will not require much adaptation. You may also see in my PR for better documentation. |
@@ -130,3 +133,96 @@ func TestAccLibvirtNetwork_Import(t *testing.T) { | |||
}, | |||
}) | |||
} | |||
|
|||
func TestAccLibvirtNetwork_EnableDhcpAndDisableItAfter(t *testing.T) { |
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.
rename this
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.
To whom are you speaking to? 😸
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.
i just reviewed my code myself 🚀 🤖 was a sidenote 🤣
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.
Please don't get angry with your reviewer 😋 . Enjoy your week-end too 🎆 .
libvirt/resource_libvirt_network.go
Outdated
@@ -131,28 +147,28 @@ func resourceLibvirtNetworkUpdate(d *schema.ResourceData, meta interface{}) erro | |||
} | |||
network, err := virConn.LookupNetworkByUUIDString(d.Id()) | |||
if err != nil { | |||
return err | |||
return fmt.Errorf("Error by retrieving network ID during update: %s", err) |
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.
Here you are not retrieving a network ID, but looking a network by its ID. I would suggest:
fmt.Errorf("Can't retrieve network with UUID '%s' during update: %s", uuid, err)
@@ -81,6 +42,48 @@ func networkExists(n string, network *libvirt.Network) resource.TestCheckFunc { | |||
} | |||
} | |||
|
|||
func testAccCheckLibvirtNetworkDhcpStatus(name string, network *libvirt.Network, DhcpStatus string) resource.TestCheckFunc { |
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.
Why is DhcpStatus
camel-cased? (and wondering... why go format or vet do not complain?)
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.
Speaking of this... In the comments, "dhcp" should be "DHCP" 😃
5934e04
to
10fc80a
Compare
@Bischoff in reply to your 2nd comment:
This is already here: if the dhcp is not enabled we set it to nil which is equivalent to your suggestion. For the domain.go yop i added the check 👍 Documentation is also improved/ @dmacvicar it is interesting the golint/go vet didn"t catch the "not formatted" function variable, i think it can be maybe an issue upstream. Feel free to review and test it. TIA |
@MalloZup ok for the second comment already applied. For the first comment, I applied it locally, and terraform does not crash anymore. Doc looks perfect now, thank you. |
5c8623f
to
ced540d
Compare
This pr contain:
Additionaly to the #288 we have: