Skip to content

Commit

Permalink
resources: virt: Catch bad calls to CheckApply
Browse files Browse the repository at this point in the history
If the engine cheats, we'll know!
  • Loading branch information
purpleidea committed Feb 26, 2017
1 parent 327b221 commit 79923a9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions resources/virt.go
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,9 @@ func (obj *VirtRes) domainShutdownSync(apply bool, dom *libvirt.Domain) (bool, e
// CheckApply checks the resource state and applies the resource if the bool
// input is true. It returns error info and if the state check passed or not.
func (obj *VirtRes) CheckApply(apply bool) (bool, error) {
if obj.conn == nil {
panic("virt: CheckApply is being called with nil connection")
}
// if we do the restart, we must flip the flag back to false as evidence
var restart bool // do we need to do a restart?
if obj.RestartOnRefresh && obj.Refresh() { // a refresh is a restart ask
Expand Down

0 comments on commit 79923a9

Please sign in to comment.