Skip to content

Commit

Permalink
Fix hypervisor sensor
Browse files Browse the repository at this point in the history
Change current state to use the name of hypervisorstate enum as expected
  • Loading branch information
gmatthews20 committed Dec 16, 2024
1 parent 1243bb0 commit 81397f6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sensors/src/hypervisor_state_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,19 @@ def poll(self):
name=hypervisor["hypervisor_name"]
)

if not prev_state == current_state:
if not prev_state == current_state.name:
payload = {
"hypervisor_name": hypervisor["hypervisor_name"],
"previous_state": prev_state,
"current_state": current_state,
"current_state": current_state.name,
}
self.sensor_service.dispatch(
trigger="stackstorm_openstack.hypervisor.state_change",
payload=payload,
)

self.sensor_service.set_value(
name=hypervisor["hypervisor_name"], value=current_state
name=hypervisor["hypervisor_name"], value=current_state.name
)

def cleanup(self):
Expand Down

0 comments on commit 81397f6

Please sign in to comment.