Skip to content
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

Add action to run after a reboot #308

Draft
wants to merge 21 commits into
base: main
Choose a base branch
from
Draft

Add action to run after a reboot #308

wants to merge 21 commits into from

Conversation

lizsalmon
Copy link
Contributor

@lizsalmon lizsalmon commented Feb 5, 2025

Description:

This PR:

  • Adds the post_reboot action to remove the scheduled downtime, removes the alertmanager silence and enables the hv in openstack when the hv is back up after a reboot
  • Bug fix to add the alertManager to openstack_actions.py.
  • Fix a typo in the migrate rule.

Note: There are so many commits because of rebasing with Jose's PR (which went a bit wrong).


Submitter:

Have you (where applicable):

  • Added unit tests?
  • Checked the latest commit runs on Dev?
  • Updated the example config file(s) and README?

Reviewer

Does this PR:

  • Place non-StackStorm code into the lib directory?
  • Have unit tests for the action/sensor and lib layers?
  • Have clear and obvious action parameter names and descriptions?

jose-caballero and others added 21 commits January 24, 2025 11:21
Implement a class with the functionalities to call AlertManager.
This is a first implementation with methods to:
* Schedule a Silence
* Removed a previously scheduled Silence
* Download information of all existing Silences
* Find out the ID of the current Silence for a given HyperVisor

Implement the class to store the specifications for each
Silence event.

The code has been written using the existing one for
icinga as guidance.
Create the ancillary file needed to implement a library to manage
silences in AlertManager:
* a file to handle credentials

This directory and its files have been created following the existing
content for icinga as guidance
Write some basic unittest for the methods to
* schedule a Silence
* remove a Silence
* get information from recorded Silences

The use cases being covered are:
* when everything goes fine
* when the RC code from the requests call is not 200
* when there the call to requests failed even though the RC is 200
* when some mandatory attribute is missing
  * an Exception is being raised
  * a proper log message is created
Implement a class with the functionalities to call AlertManager.
This is a first implementation with methods to:
* Schedule a Silence
* Removed a previously scheduled Silence
* Download information of all existing Silences
* Find out the ID of the current Silence for a given HyperVisor

Implement the class to store the specifications for each
Silence event.

The code has been written using the existing one for
icinga as guidance.
Write some basic unittest for the methods to
* schedule a Silence
* remove a Silence
* get information from recorded Silences

The use cases being covered are:
* when everything goes fine
* when the RC code from the requests call is not 200
* when some mandatory attribute is missing
  * an Exception is being raised
  * a proper log message is created
* the format of start_time and end_time strings
Copy link

codecov bot commented Feb 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.05%. Comparing base (2fb4da6) to head (abf893c).
Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #308      +/-   ##
==========================================
- Coverage   98.19%   98.05%   -0.15%     
==========================================
  Files         129      137       +8     
  Lines        4719     5251     +532     
  Branches      251      286      +35     
==========================================
+ Hits         4634     5149     +515     
- Misses         76       88      +12     
- Partials        9       14       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants