Commit Graph

33 Commits

Author SHA1 Message Date
Caihui cff3d800ee Remove the __future__ modulue
The __future__ module [1] was used in this context to ensure compatibility
between python 2 and python 3. This version is not support  python 2 any more.

[1] https://docs.python.org/3/library/__future__.html

Change-Id: I94c61ba495283fc6e461bec156a7007ecbd6bb50
2020-06-19 22:52:55 -07:00
Caihui 9a214616ec Remove keystone v2 related code
Change-Id: I9de621ee973d62fe845e18907ee21f5e64ae401c
2020-06-19 20:45:25 -07:00
Andreas Jaeger 72de51b01c Cleanup py27 support
This repo is now testing only with Python 3, so let's make
a few cleanups:
- Remove python 2.7 stanza from setup.py
- Add requires on python >= 3.6 to setup.cfg so that pypi and pip
  know about the requirement
- Remove obsolete sections from setup.cfg
- Update classifiers
- Update requirements, no need for python_version anymore
- Switch to using sphinx-build with warnings enabled, fix
  warnings found with autodoc
- Cleanup doc/source/conf.py to remove now obsolete content.
- Use newer openstackdocstheme version, switch to using apidoc
- Remove install_command from tox.ini, the default is fine
- Change some imports to use python3 changed names

Change-Id: Ibb2e614c7db8a01e41caed8314c1d46479c78295
2020-04-12 20:58:22 +02:00
caihui b9ef93c2f1 Remove six useage
We don't support python2 anymore so we don't need this compatibility
library.

This patch remove six useage.

Change-Id: I5802ee67960ff8c53bc33213cc5aa8baee0d0dce
2020-02-18 01:29:51 -08:00
Zuul 86cf4f707a Merge "Set default notifier endpoint" 2018-11-19 09:22:28 +00:00
Cai Hui b008ef902d Update tox.ini and fix pep8 errors
1.Add [testenv:lower-constraints]
2.Add lower-constraints.txt
3.Check env:UPPER_CONSTRAINTS_FILE
4.Remove  passenv parameters which are not required
5.Fix pep8 errors

Change-Id: I8ec8aac38e80a6e2b8ce9e9dc70f0cf187c0ce7c
2018-11-07 06:14:17 -05:00
Chen eeb86e8b78 Define get_info method in evacuator backend drivers
This is needed because get_info is declared as a abstract method
in the base class [1].

[1] https://github.com/openstack/freezer-dr/blob/master/freezer_dr/evacuators/common/driver.py#L45

Change-Id: I0400da74d287b7903b0b0552deb98b10ea7e2b0d
Closes-Bug: #1798255
2018-10-17 14:57:32 +08:00
Chen f3e4fc01a2 Set default notifier endpoint
The notifier endpoint needs to be set otherwise the default default_email
notifier driver will complain about the empty smtp server url [1].

[1] https://github.com/openstack/freezer-dr/blob/master/freezer_dr/notifiers/drivers/default/default_email.py#L37-L38

Change-Id: I9ac4669ecc50ce93adf28084ab6280b66c4dc2f0
2018-10-15 20:28:09 +08:00
Zuul 329c210889 Merge "Fix notifier should only notify successfully evacuated nodes" 2018-08-28 13:55:00 +00:00
Zuul 7e9873df79 Merge "[WIP] Implement Slack notification plugin" 2018-08-20 10:13:38 +00:00
Trinh Nguyen e13dec53f9 Fix notifier should only notify successfully evacuated nodes
Currently, Freezer' notifier when notifying about successful
evacuated nodes notifies all nodes.

    ...
    notify_nodes = evac.get_nodes_details(nodes)
    ...
    notifier.notify(notify_nodes, 'success')

Change-Id: I1f301b458a6407e5d98445707c00775ca730781f
2018-08-16 14:45:11 +09:00
Trinh Nguyen 4ae1693bd0 [WIP] Implement Slack notification plugin
Right now, Freezer-DR notification engine only supports email.
This patch add support for sending notification to Slack channels.

Change-Id: Ie19f71e9922750fcb295b7c808d423b2c01a1fc5
2018-08-14 01:23:07 +09:00
Trinh Nguyen 964cae63c5 Fix notifier manager typos
notifer_conf -> notifier_conf

Change-Id: I9d28ad900f646301e8e11f4e7d07c52186de6735
2018-08-09 16:21:01 +09:00
Doug Hellmann 41aa05b580 replace iteritems with items
Under python 3 dictionaries do not have an iteritems() method. Replace
the call with items(), which works for both python 2 and 3.

Change-Id: I088940350c88a9c02f53fb578b37d2b600a05448
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-06-06 19:03:48 -04:00
Doug Hellmann f9766e1187 update print statement to work for python 2 and 3
Use the __future__ module to ensure print is a function and then use
it that way.

Change-Id: Iccd0018434e044354e90b16ca67bdbeb312b6151
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-06-06 19:03:48 -04:00
Doug Hellmann b41978a287 replace file with open
Under python 3 the builtin 'file' no longer exists, so replace it with
'open' which works for both python 2 and 3.

Change-Id: Iaf438588e4bfab2833f92de0b31b0a9cfd14e597
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-06-06 19:03:48 -04:00
Tomasz Trębski 44e6f2be51 Removed unused config options
monascaclient does not respect
`include_catalog` and `interface` arguments.
Also, `interface` is primarly used to query
Keystone catalog for an endpoint. That step
is not required as endpoint for monasca-api
is set manually.

Change-Id: Iceaa938dfe1a2aeece258def3336b8557d560a51
2017-08-02 14:32:34 +02:00
Saad Zaher b1116e787b Fix update nodes in fencers
Update nodes allows the evacuators to initialize the fencers with
fake nodes then update it with correct one and fence.

Change-Id: I9fc54a99b6782138c6c9a76c9cec99e26b638777
2017-07-18 16:02:33 +01:00
Jenkins 56efab7b54 Merge "Refactor evacuators" 2017-07-14 09:07:26 +00:00
Saad Zaher e01bf61472 Refactoring fencers
Allow freezer-dr to load fencers more generically and give the drivers
space to implement their own fencing procedure

Change-Id: I5272ca90d806b8ce83055199724abdc14fe414bc
2017-07-13 20:37:42 +01:00
Saad Zaher b5af64bd82 Refactor evacuators
Allow the evacuators part to be able to do more and to freely evacuate
different types of the workloads(full compute, vms, ...)

Change-Id: I2e8b23a48504b8e4ea13f6b86cb9689d9bab5cf1
Depends-On: I5272ca90d806b8ce83055199724abdc14fe414bc
2017-07-13 20:33:48 +01:00
Saad Zaher b4fc9a6f9e Allow Monasca driver to process enabled nodes only
Compute nodes might be disabled or set to maintenance mode, so
freezer-dr needs to process only enabled nodes to avoid any
problems.

Change-Id: I7a367516008ff7653126621f0761506356d41f05
2016-12-12 11:31:44 +00:00
Vitaliy a8b664d74c Change according to preferred word choice
According to preferred word choice document [1] we should use only
"OpenStack" term in our guides, READme documents and so on.

This patch fix our docs and other files according to these requirements.

[1] http://docs.openstack.org/contributor-guide/writing-style/word-choice.html

Change-Id: Iff395ad887f733245da338ec707b862a8ec42d8b
2016-11-29 00:29:13 +00:00
Saad Zaher 5af54e4f62 Added python-monascaclient and Added more doc for Monasca driver
Enrich monasca-driver doc strings and documented un-documented methods
Added missing Monasca client dependency

Change-Id: Ie3dd02e5c70415a4e05d1add19a79de33705b712
2016-11-23 16:40:51 +00:00
Saad Zaher 61558d2b33 Notify if metrics are not defined or not added for hosts
Now Monitoring driver is getting notifier instance to be used
in case of failure get data for a certain metric or failed to find
the metric added on a certain host, the notifier will be used to
notify admins list (notify-list in config file) that something is
wrong with the metrics and need to look at it

Base notification driver changed to support the following methods:

1. notify_status: will be used to notify if node is failed and
   evacuated
2. notify: will be used anywhere in monitoring drivers to notify
administrators if something is wrong.

Change-Id: I12eddf03d1921a04f5fa9a8101a471bea5f9c507
2016-11-21 17:06:23 +00:00
Saad Zaher 7ca4980a8c Implemented Monasca Monitoring Driver
Use Monasca to monitor the compute nodes.

Change-Id: If1ac08d6bbafc065796e89836aa6175e57ef0a54
Implements: blueprint implement-monasca-monitoring-driver
Depends-On: Id330e5500f07ff19b7a2f82df236a4e0108668c9
2016-11-17 16:36:22 +00:00
Saad Zaher b9bb720100 Refactor the base monitoring driver
Refactoring the base monitoring driver to load driver configuration
from a seperate section in the configuration file. This will allow
drivers to load their own configurations freely
Implements: blueprint dr-refactor-monitoring-drivers

Change-Id: Id330e5500f07ff19b7a2f82df236a4e0108668c9
Depends-On: I7fdf27e8f9263625e1fd1e2a34c015eaf4251792
2016-11-17 14:18:33 +00:00
Jenkins a42999fe49 Merge "Docstrings should not start with a space" 2016-11-14 13:19:31 +00:00
Saad Zaher 91b034da78 Updating freezer-dr osclient
Change-Id: Ice3f16f2597bb999d6be433facf85df5c9687de9
2016-11-03 12:09:58 +00:00
Cao Xuan Hoang abeda56eea Docstrings should not start with a space
As per OpenStack Docstrings guide lines [1]:
[H401] Docstrings should not start with a space.
[H403] Multi line docstrings should end on a new line.
[H404] Multi line docstrings should start without a leading new line.
[H405] Multi line docstrings should start with a one line summary
followed by an empty line.

[1] http://docs.openstack.org/developer/hacking/#docstrings

trivialfix

Change-Id: Ife5049b73c65b7dc3eecc18567343ed95fdfe05c
2016-09-27 13:20:24 +07:00
Saad Zaher 3c6c6b8697 Allow the evacuator to enable passing shared storage parameter to nova
Boolean flag will be set to True in case of compute nodes are running
on a shared storage and will be False otherwise

Depends-On: Ie6f3f12efafbca530271d6771fac83480ee19000

Change-Id: I46e9eb2e1ace17959a02b3107e5ad3e85e2cd851
implements: blueprint dr-enable-shared-storage
2016-06-06 10:00:38 +00:00
Saad Zaher 7d7d189545 Added .gitreview
Change-Id: I42f5bbb4a6bc12445c3ea571134a614395b0fd34
2016-05-12 13:10:52 +00:00
Saad Zaher 7538cd7ac8 freezer-dr big bang
Moving everything to freezer repo
2016-05-09 09:55:31 +00:00