Commit Graph

5 Commits

Author SHA1 Message Date
suzhengwei fe88eae9cb add enabled to segment
Sometimes, operators want to temporarily close instance-ha function.
This patch add 'enabled' to segment. If the segment 'enabled' value
is set False, all notifications of this segment will be ignored
and no recovery methods will execuate.

Change-Id: I561a2519626fa1beae1e3033a6de510cea8f3fac
Implements: BP enable-to-segment
2021-03-03 10:42:35 +08:00
Sean McGinnis 9a59610643
Use unittest.mock instead of third party mock
Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.

Change-Id: Ia6927351f591be0c57fd73515b2542a0af35f82b
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-04-18 11:54:10 -05:00
Kengo Takahara 0616b4bd99 Send notifications for all API changes
This patch send notifications for all API changes.
1. Segment: create, update, delete
2. Host: create, update, delete
3. Notifications: create, update

Co-Authored-By: Shilpa Devharakar <Shilpa.Devharakar@nttdata.com>

Change-Id: I02411db0b3563f6a24e164dbaf50bb30744c2fda
Implements: bp notifications-in-masakari
2019-03-05 10:46:23 +05:30
Dinesh Bhor d4f982449e Use os-testr instead of testr
Masakari should use ostestr instead of testr. ostestr is more
powerful and provide much prettier output than testr. Other
projects like cinder, nova, glance, neutron etc already uses
the ostestr wrapper.

Using ostestr shows each tests execution separately because of
which it has shown errors related to "KeyError" in existing test
cases. The error looks like below:

"Exception in string format operation: KeyError: u'id'"

This happens if we don't pass keyword argument like "id" to
exception which we expect to be raised from test through
side_effect [1]. This doesn't lead to test failure but it
appears in test logs. This patch fixes such issues by passing
expected keyword arguments to exceptions.

[1] https://github.com/openstack/masakari/blob/master/masakari/tests/unit/api/openstack/ha/test_hosts.py#L364
Change-Id: I91603ea3dcf35fd20a00dcf477b93d612edca362
2017-07-05 17:37:52 +05:30
dineshbhor 726a3937d2 Added masakari objects
Added hosts and failover segment related objects including
their respective test cases.

Change-Id: I6beaf38f23aa7d053303ef4b333a30f0c5416f4d
2016-09-07 15:57:17 +05:30