Skip to content

Commit

Permalink
Ironic: Use hostUpdated() to handle Status updates
Browse files Browse the repository at this point in the history
Denote instances where we are returning due to data in the Host's Status
structure being updated by calling the hostUpdated() function to get a
Result.
  • Loading branch information
zaneb committed Jan 14, 2021
1 parent 1e6fd34 commit 4b4c29d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/provisioner/ironic/ironic.go
Expand Up @@ -388,7 +388,7 @@ func (p *ironicProvisioner) ValidateManagementAccess(credentialsChanged, force b
// Store the ID so other methods can assume it is set and so
// we can find the node again later.
p.status.ID = ironicNode.UUID
result.Dirty = true
result, err = hostUpdated()
p.log.Info("setting provisioning id", "ID", p.status.ID)

// If we know the MAC, create a port. Otherwise we will have
Expand Down Expand Up @@ -447,7 +447,7 @@ func (p *ironicProvisioner) ValidateManagementAccess(credentialsChanged, force b
// Store the ID so other methods can assume it is set and
// so we can find the node using that value next time.
p.status.ID = ironicNode.UUID
result.Dirty = true
result, err = hostUpdated()
p.log.Info("setting provisioning id", "ID", p.status.ID)
}

Expand Down Expand Up @@ -717,7 +717,7 @@ func (p *ironicProvisioner) UpdateHardwareState() (result provisioner.Result, er
if discoveredVal != p.host.Status.PoweredOn {
p.log.Info("updating power status", "discovered", discoveredVal)
p.host.Status.PoweredOn = discoveredVal
result.Dirty = true
return hostUpdated()
}
return result, nil
}
Expand Down

0 comments on commit 4b4c29d

Please sign in to comment.