freezer-dr big bang

Moving everything to freezer repo
This commit is contained in:
Saad Zaher 2016-05-09 09:55:31 +00:00
parent 92640b67f4
commit 7538cd7ac8
72 changed files with 126 additions and 213 deletions

6
AUTHORS Normal file
View File

@ -0,0 +1,6 @@
Jonas Pfannschmidt <jonas.pfannschmidt@hp.com>
Pierre-Arthur MATHIEU <pierre-arthur.mathieu@hp.com>
Project Creator <gozer@hp.com>
Saad Zaher <saad.zaher@hp.com>
Stefano Canepa <stefano.canepa@hp.com>
Zuul <zuul@hpcloud.net>

22
ChangeLog Normal file
View File

@ -0,0 +1,22 @@
CHANGES
=======
* Dummy evacuator and monitor driver for testing
* Adding CREDITS.rst
* Adding Osha description and enhancing templates Fixing some template issues and adding osha description and how it works
* Some small improvements to pass pep8 and pep257
* Add oslo.log dependency in requirements.txt
* Adding HACKING.rst to follow Openstack Guidelines
* Adding Notification System and Notification Drivers Support sending notification emails in case of any problem happened
* Evacuation is working now and node will be evacuated but ? We need to contact nova guys to ask why when we disable or enable a node the node state is always going up even if the node is powereded off. We had to wait and retry many times for 1 minute at least to give nova compute sometime to update nova api with it's state
* Buidling a plugable evacuators - still need some work !
* Fixing keystone Configuration adding keystone_authtoken to config file and remove keystone old section
* Add disable node to osclient
* Adding libvirt Fencer driver
* Fixing typo fencor > fencer
* Modified diagrams
* Adding Fencing plugable system
* Adding support for plugable monitoring systems adding support for pbr restructuring osha
* Big Bang
* Add diagram
* Added .gitreview

View File

@ -1,11 +1,11 @@
Osha Style Commandments Freezer DR Style Commandments
=========================== ===========================
- Step 1: Read the OpenStack Style Commandments - Step 1: Read the OpenStack Style Commandments
http://docs.openstack.org/developer/hacking/ http://docs.openstack.org/developer/hacking/
- Step 2: Read on - Step 2: Read on
Osha Specific Commandments Freezer DR Specific Commandments
------------------------------ ------------------------------
Logging Logging

View File

@ -1,14 +1,14 @@
================== ==================
OSHA Freezer Disaster Recovery
================== ==================
Osha, Openstack Compute node High Available provides compute node high availability for OpenStack. freezer-dr, Openstack Compute node High Available provides compute node high availability for OpenStack.
Simply Osha monitors all compute nodes running in a cloud deployment and if there is any failure Simply freezer-dr monitors all compute nodes running in a cloud deployment and if there is any failure
in one of the compute nodes osha will fence this compute node then osha will try to evacuate all in one of the compute nodes freezer-dr will fence this compute node then freezer-dr will try to evacuate all
running instances on this compute node, finally Osha will notify all users who have workload/instances running instances on this compute node, finally freezer-dr will notify all users who have workload/instances
running on this compute node as well as will notify the cloud administrators. running on this compute node as well as will notify the cloud administrators.
Osha has a pluggable architecture so it can be used with: freezer-dr has a pluggable architecture so it can be used with:
1. Any monitoring system to monitor the compute nodes (currently we support only native openstack services status) 1. Any monitoring system to monitor the compute nodes (currently we support only native openstack services status)
2. Any fencing driver (currently supports IPMI, libvirt, ...) 2. Any fencing driver (currently supports IPMI, libvirt, ...)
@ -18,23 +18,23 @@ Osha has a pluggable architecture so it can be used with:
just by adding a simple plugin and adjust the configuration file to use this just by adding a simple plugin and adjust the configuration file to use this
plugin or in future a combination of plugins if required plugin or in future a combination of plugins if required
Osha should run in the control plane, however the architecture supports different scenarios. freezer-dr should run in the control plane, however the architecture supports different scenarios.
For running osha under high availability mode, it should run with active passive mode. For running freezer-dr under high availability mode, it should run with active passive mode.
----------------- -----------------
How it works How it works
----------------- -----------------
Starting Osha Starting freezer-dr
1. Osha Monitoring manager is going to load the required monitoring driver according to the configuration 1. freezer-dr Monitoring manager is going to load the required monitoring driver according to the configuration
2. Osha will query the monitoring system to check if it considers any compute nodes to be down ? 2. freezer-dr will query the monitoring system to check if it considers any compute nodes to be down ?
3.1. if no, Osha will exit displaying No failed nodes 3.1. if no, freezer-dr will exit displaying No failed nodes
3.2. if yes, Osha will call the fencing manager to fence the failed compute node 3.2. if yes, freezer-dr will call the fencing manager to fence the failed compute node
4. Fencing manager will load the correct fencer according to the configuration 4. Fencing manager will load the correct fencer according to the configuration
5. once the compute node is fenced and is powered off now we will start the evacuation process 5. once the compute node is fenced and is powered off now we will start the evacuation process
6. Osha will load the correct evacuation driver 6. freezer-dr will load the correct evacuation driver
7. Osha will evacuate all instances to another computes 7. freezer-dr will evacuate all instances to another computes
8. Once the evacuation process completed, Osha will call the notification manager 8. Once the evacuation process completed, freezer-dr will call the notification manager
9. The notification manager will load the correct driver based on the configurations 9. The notification manager will load the correct driver based on the configurations
10. Osha will start the notification process ... 10. freezer-dr will start the notification process ...

View File

@ -0,0 +1,5 @@
[DEFAULT]
output_file = etc/freezer-dr.conf.sample
wrap_width = 79
namespace = freezer-dr
namespace = oslo.log

View File

@ -1,5 +0,0 @@
[DEFAULT]
output_file = etc/osha.conf.sample
wrap_width = 79
namespace = osha
namespace = oslo.log

View File

@ -1,7 +1,7 @@
[DEFAULT] [DEFAULT]
# #
# From osha # From freezer-dr
# #
# Time to wait between different operations (integer value) # Time to wait between different operations (integer value)
@ -94,12 +94,12 @@
[evacuation] [evacuation]
# #
# From osha # From freezer-dr
# #
# Time in seconds to wait between retries to disable compute node or put it in # Time in seconds to wait between retries to disable compute node or put it in
# maintenance mode. Default 10 seconds (string value) # maintenance mode. Default 10 seconds (string value)
#driver = osha.evacuators.drivers.osha.standard.OshaStandardEvacuator #driver = freezer_dr.evacuators.drivers.default.standard.StandardEvacuator
# Time in seconds to wait between retries to disable compute node or put it in # Time in seconds to wait between retries to disable compute node or put it in
# maintenance mode. Default 10 seconds (integer value) # maintenance mode. Default 10 seconds (integer value)
@ -118,7 +118,7 @@
[fencer] [fencer]
# #
# From osha # From freezer-dr
# #
# YAML File contains the required credentials for compute nodes (string value) # YAML File contains the required credentials for compute nodes (string value)
@ -133,7 +133,7 @@
#hold_period = 10 #hold_period = 10
# Choose the best fencer driver i.e.(ipmi, libvirt, .. (string value) # Choose the best fencer driver i.e.(ipmi, libvirt, .. (string value)
#driver = osha.fencers.drivers.ipmi.driver.IpmiDriver #driver = freezer_dr.fencers.drivers.ipmi.driver.IpmiDriver
# List of kwargs to customize the fencer operation. You fencer driver should # List of kwargs to customize the fencer operation. You fencer driver should
# support these options. Options should be in key:value format (dict value) # support these options. Options should be in key:value format (dict value)
@ -143,7 +143,7 @@
[keystone_authtoken] [keystone_authtoken]
# #
# From osha # From freezer-dr
# #
# Openstack auth URI i.e. http://controller:5000 (string value) # Openstack auth URI i.e. http://controller:5000 (string value)
@ -188,11 +188,11 @@
[monitoring] [monitoring]
# #
# From osha # From freezer-dr
# #
# Driver used to get a status updates of compute nodes (string value) # Driver used to get a status updates of compute nodes (string value)
#driver = osha.monitors.drivers.osha.driver.OshaDriver #driver = freezer_dr.monitors.drivers.default.driver.StandardDriver
# username to be used to initialize the monitoring driver (string value) # username to be used to initialize the monitoring driver (string value)
#username = <None> #username = <None>
@ -211,12 +211,12 @@
[notifiers] [notifiers]
# #
# From osha # From freezer-dr
# #
# Notification driver to load it to notify users if something went wrong # Notification driver to load it to notify users if something went wrong
# (string value) # (string value)
#driver = osha.notifiers.drivers.osha.default_email.OshaEmail #driver = freezer_dr.notifiers.drivers.default.default_email.StandardEmail
# Endpoint URL for the notification system. If you the driver you are using # Endpoint URL for the notification system. If you the driver you are using
# doesnot require any URL just comment it or use none (string value) # doesnot require any URL just comment it or use none (string value)
@ -234,14 +234,14 @@
# Path to Jinja2 templates directory that contains message templates (string # Path to Jinja2 templates directory that contains message templates (string
# value) # value)
#templates-dir = /etc/osha/templates #templates-dir = /etc/freezer/templates
# Key:Value Kwargs to pass it to the notification driver, if you want to pass # Key:Value Kwargs to pass it to the notification driver, if you want to pass
# any special arguments for your driver. (dict value) # any special arguments for your driver. (dict value)
#options = #options =
# List of emails to sent them notification if something went wrong and Osha # List of emails to sent them notification if something went wrong and Freezer
# wasnot able to send an email to the tenant admin (list value) # DR wasnot able to send an email to the tenant admin (list value)
#notify-list = #notify-list =
# The sender address, it can be email address if we used default email driver, # The sender address, it can be email address if we used default email driver,

View File

@ -12,9 +12,9 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# Osha Versions # Freezer-DR Versions
import pbr.version import pbr.version
__version__ = pbr.version.VersionInfo('osha').version_string() __version__ = pbr.version.VersionInfo('freezer-dr').version_string()

View File

View File

@ -18,15 +18,17 @@ import sys
from oslo_config import cfg from oslo_config import cfg
from oslo_log import log from oslo_log import log
from osha import __version__ as OSHA_VERSION from freezer_dr import __version__ as FREEZER_DR_VERSION
from osha.common.utils import env from freezer_dr.common.utils import env
CONF = cfg.CONF CONF = cfg.CONF
_MONITORS = [ _MONITORS = [
cfg.StrOpt('driver', cfg.StrOpt('driver',
default='osha.monitors.drivers.osha.driver.OshaDriver', default='freezer_dr.monitors.drivers.default.driver.'
'StandardDriver',
help='Driver used to get a status updates of compute nodes'), help='Driver used to get a status updates of compute nodes'),
cfg.StrOpt('username', cfg.StrOpt('username',
help='username to be used to initialize the monitoring driver'), help='username to be used to initialize the monitoring driver'),
@ -61,7 +63,7 @@ _FENCER = [
'reasonable amount of time as different servers take ' 'reasonable amount of time as different servers take '
'different times to shut off'), 'different times to shut off'),
cfg.StrOpt('driver', cfg.StrOpt('driver',
default='osha.fencers.drivers.ipmi.driver.IpmiDriver', default='freezer_dr.fencers.drivers.ipmi.driver.IpmiDriver',
help='Choose the best fencer driver i.e.(ipmi, libvirt, ..'), help='Choose the best fencer driver i.e.(ipmi, libvirt, ..'),
cfg.DictOpt('options', cfg.DictOpt('options',
default={}, default={},
@ -113,8 +115,8 @@ _KEYSTONE_AUTH_TOKEN = [
_EVACUATION = [ _EVACUATION = [
cfg.StrOpt( cfg.StrOpt(
'driver', 'driver',
default='osha.evacuators.drivers.osha.standard.' default='freezer_dr.evacuators.drivers.default.standard.'
'OshaStandardEvacuator', 'StandardEvacuator',
help='Time in seconds to wait between retries to disable compute' help='Time in seconds to wait between retries to disable compute'
' node or put it in maintenance mode. Default 10 seconds', ' node or put it in maintenance mode. Default 10 seconds',
dest='driver'), cfg.IntOpt( dest='driver'), cfg.IntOpt(
@ -140,7 +142,8 @@ _EVACUATION = [
_NOTIFIERS = [ _NOTIFIERS = [
cfg.StrOpt('driver', cfg.StrOpt('driver',
default='osha.notifiers.drivers.osha.default_email.OshaEmail', default='freezer_dr.notifiers.drivers.default.default_email.'
'StandardEmail',
dest='driver', dest='driver',
help='Notification driver to load it to notify users ' help='Notification driver to load it to notify users '
'if something went wrong'), 'if something went wrong'),
@ -165,7 +168,7 @@ _NOTIFIERS = [
'authentications comment or use None'), 'authentications comment or use None'),
cfg.StrOpt('templates-dir', cfg.StrOpt('templates-dir',
dest='templates-dir', dest='templates-dir',
default='/etc/osha/templates', default='/etc/freezer/templates',
help='Path to Jinja2 templates directory that contains ' help='Path to Jinja2 templates directory that contains '
'message templates'), 'message templates'),
cfg.DictOpt('options', cfg.DictOpt('options',
@ -178,7 +181,7 @@ _NOTIFIERS = [
default=[], default=[],
dest='notify-list', dest='notify-list',
help='List of emails to sent them notification if something ' help='List of emails to sent them notification if something '
'went wrong and Osha wasnot able to send an email to the ' 'went wrong and Freezer DR wasnot able to send an email to the '
'tenant admin'), 'tenant admin'),
cfg.StrOpt('notify-from', cfg.StrOpt('notify-from',
dest='notify-from', dest='notify-from',
@ -302,7 +305,7 @@ def configure():
CONF.register_group(notifiers_grp) CONF.register_group(notifiers_grp)
CONF.register_opts(_NOTIFIERS, group='notifiers') CONF.register_opts(_NOTIFIERS, group='notifiers')
# Osha Auth # Keystone Auth
keystone_grp = cfg.OptGroup('keystone_authtoken', keystone_grp = cfg.OptGroup('keystone_authtoken',
title='Keystone Auth Options', title='Keystone Auth Options',
help='Openstack Credentials to call the nova ' help='Openstack Credentials to call the nova '
@ -310,13 +313,13 @@ def configure():
CONF.register_group(keystone_grp) CONF.register_group(keystone_grp)
CONF.register_opts(_KEYSTONE_AUTH_TOKEN, group='keystone_authtoken') CONF.register_opts(_KEYSTONE_AUTH_TOKEN, group='keystone_authtoken')
default_conf = cfg.find_config_files('osha', 'osha', '.conf') default_conf = cfg.find_config_files('freezer', 'freezer-dr', '.conf')
log.register_options(CONF) log.register_options(CONF)
CONF(args=sys.argv[1:], CONF(args=sys.argv[1:],
project='osha', project='freezer',
default_config_files=default_conf, default_config_files=default_conf,
version=OSHA_VERSION) version=FREEZER_DR_VERSION)
def setup_logging(): def setup_logging():
@ -326,7 +329,7 @@ def setup_logging():
'iso8601=WARN', 'iso8601=WARN',
'requests.packages.urllib3.connectionpool=WARN', 'requests.packages.urllib3.connectionpool=WARN',
'urllib3.connectionpool=WARN', 'websocket=WARN', 'urllib3.connectionpool=WARN', 'websocket=WARN',
'keystonemiddleware=WARN', 'osha=INFO'] 'keystonemiddleware=WARN', 'freezer-dr=INFO']
_DEFAULT_LOGGING_CONTEXT_FORMAT = ( _DEFAULT_LOGGING_CONTEXT_FORMAT = (
'%(asctime)s.%(msecs)03d %(process)d ' '%(asctime)s.%(msecs)03d %(process)d '
@ -334,7 +337,7 @@ def setup_logging():
'%(user_identity)s] %(instance)s' '%(user_identity)s] %(instance)s'
'%(message)s') '%(message)s')
log.set_defaults(_DEFAULT_LOGGING_CONTEXT_FORMAT, _DEFAULT_LOG_LEVELS) log.set_defaults(_DEFAULT_LOGGING_CONTEXT_FORMAT, _DEFAULT_LOG_LEVELS)
log.setup(CONF, 'osha', version=OSHA_VERSION) log.setup(CONF, 'freezer-dr', version=FREEZER_DR_VERSION)
def list_opts(): def list_opts():

View File

@ -19,7 +19,7 @@ import jinja2
from oslo_config import cfg from oslo_config import cfg
from oslo_log import log from oslo_log import log
from osha.common.osclient import OSClient from freezer_dr.common.osclient import OSClient
CONF = cfg.CONF CONF = cfg.CONF

View File

View File

View File

@ -14,9 +14,9 @@
from oslo_config import cfg from oslo_config import cfg
from oslo_log import log from oslo_log import log
from oslo_utils import importutils from oslo_utils import importutils
from osha.fencers.common.manager import FencerManager from freezer_dr.fencers.common.manager import FencerManager
from time import sleep from time import sleep
from osha.evacuators.common.utils import get_nodes_details from freezer_dr.evacuators.common.utils import get_nodes_details
CONF = cfg.CONF CONF = cfg.CONF
LOG = log.getLogger(__name__) LOG = log.getLogger(__name__)

View File

@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from osha.common.utils import get_os_client, get_admin_os_client from freezer_dr.common.utils import get_os_client, get_admin_os_client
def get_nodes_details(nodes): def get_nodes_details(nodes):

View File

@ -13,16 +13,16 @@
# limitations under the License. # limitations under the License.
from oslo_config import cfg from oslo_config import cfg
from oslo_log import log from oslo_log import log
from osha.evacuators.common.driver import EvacuatorBaseDriver from freezer_dr.evacuators.common.driver import EvacuatorBaseDriver
from osha.common.utils import get_os_client from freezer_dr.common.utils import get_os_client
CONF = cfg.CONF CONF = cfg.CONF
LOG = log.getLogger(__name__) LOG = log.getLogger(__name__)
class OshaStandardEvacuator(EvacuatorBaseDriver): class StandardEvacuator(EvacuatorBaseDriver):
def __init__(self, wait, retires, **kwargs): def __init__(self, wait, retires, **kwargs):
super(OshaStandardEvacuator, self).__init__(wait, retires, **kwargs) super(StandardEvacuator, self).__init__(wait, retires, **kwargs)
self.client = get_os_client() self.client = get_os_client()
def get_node_instances(self, node): def get_node_instances(self, node):

View File

@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from osha.evacuators.common.driver import EvacuatorBaseDriver from freezer_dr.evacuators.common.driver import EvacuatorBaseDriver
class DummyEvacuator(EvacuatorBaseDriver): class DummyEvacuator(EvacuatorBaseDriver):

View File

View File

@ -33,9 +33,9 @@ class FencerBaseDriver(object):
Any fencer driver requires the following parameters to do the api Any fencer driver requires the following parameters to do the api
calls. All these parameters can be passed from the configuration calls. All these parameters can be passed from the configuration
file in /etc/osha/osha.conf (default). file in /etc/freezer/dr.conf (default).
:param node: dict with all node details. (/etc/osha/servers.yml) ? :param node: dict with all node details. (/etc/freezer/servers.yml) ?
:param kwargs: any additional parameters can be passed using this :param kwargs: any additional parameters can be passed using this
config option. config option.
""" """

View File

@ -14,7 +14,7 @@
from oslo_config import cfg from oslo_config import cfg
from oslo_log import log from oslo_log import log
from oslo_utils import importutils from oslo_utils import importutils
from osha.common.yaml_parser import YamlParser from freezer_dr.common.yaml_parser import YamlParser
from time import sleep from time import sleep
CONF = cfg.CONF CONF = cfg.CONF

View File

View File

@ -11,8 +11,8 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from osha.fencers.common.driver import FencerBaseDriver from freezer_dr.fencers.common.driver import FencerBaseDriver
from osha.fencers.drivers.ipmi.ipmitool import IpmiInterface from freezer_dr.fencers.drivers.ipmi.ipmitool import IpmiInterface
from oslo_log import log from oslo_log import log
from oslo_config import cfg from oslo_config import cfg

View File

@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from osha.fencers.common.driver import FencerBaseDriver from freezer_dr.fencers.common.driver import FencerBaseDriver
from oslo_log import log from oslo_log import log
from oslo_config import cfg from oslo_config import cfg
import libvirt import libvirt

View File

@ -11,12 +11,12 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from osha.common import config from freezer_dr.common import config
from oslo_config import cfg from oslo_config import cfg
from oslo_log import log from oslo_log import log
from osha.monitors.common.manager import MonitorManager from freezer_dr.monitors.common.manager import MonitorManager
from osha.evacuators.common.manager import EvacuationManager from freezer_dr.evacuators.common.manager import EvacuationManager
from osha.notifiers.common.manager import NotificationManager from freezer_dr.notifiers.common.manager import NotificationManager
CONF = cfg.CONF CONF = cfg.CONF
LOG = log.getLogger(__name__) LOG = log.getLogger(__name__)
@ -25,7 +25,7 @@ LOG = log.getLogger(__name__)
def main(): def main():
config.configure() config.configure()
config.setup_logging() config.setup_logging()
LOG.info('Starting osha ... ') LOG.info('Starting Freezer DR ... ')
# load and initialize the monitoring driver # load and initialize the monitoring driver
monitor = MonitorManager() monitor = MonitorManager()
# Do the monitoring procedure # Do the monitoring procedure

View File

View File

@ -27,7 +27,7 @@ class MonitorBaseDriver(object):
""" """
Initializing the driver. Any monitoring system requires the following Initializing the driver. Any monitoring system requires the following
parameters to call it's api. All these parameters can be passed from the parameters to call it's api. All these parameters can be passed from the
configuration file in /etc/osha/osha.conf configuration file in /etc/freezer/dr.conf
:param username: Username :param username: Username
:param password: Password :param password: Password
:param endpoint: API URL :param endpoint: API URL

View File

View File

@ -11,8 +11,8 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from osha.common.osclient import OSClient from freezer_dr.common.osclient import OSClient
from osha.monitors.common.driver import MonitorBaseDriver from freezer_dr.monitors.common.driver import MonitorBaseDriver
from time import sleep from time import sleep
from oslo_config import cfg from oslo_config import cfg
from oslo_log import log from oslo_log import log
@ -23,10 +23,10 @@ CONF = cfg.CONF
LOG = log.getLogger(__name__) LOG = log.getLogger(__name__)
class OshaDriver(MonitorBaseDriver): class StandardDriver(MonitorBaseDriver):
def __init__(self, username, password, endpoint, **kwargs): def __init__(self, username, password, endpoint, **kwargs):
super(OshaDriver, self).__init__(username, password, endpoint, **kwargs) super(StandardDriver, self).__init__(username, password, endpoint, **kwargs)
client = OSClient( client = OSClient(
authurl=endpoint, authurl=endpoint,
username=username, username=username,
@ -97,12 +97,11 @@ class OshaDriver(MonitorBaseDriver):
def get_info(self): def get_info(self):
return { return {
'name': 'Osha Native Driver', 'name': 'Freezer DR Native Driver',
'version': 1.0, 'version': 1.0,
'author': 'Hewlett-Packard Development Company, L.P' 'author': 'Hewlett-Packard Development Company, L.P'
} }
def is_hpyervisor_down(self, hypervisors): def is_hpyervisor_down(self, hypervisors):
down_hosts = [] down_hosts = []
for hypervisor in hypervisors: for hypervisor in hypervisors:

View File

@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from osha.monitors.common.driver import MonitorBaseDriver from freezer_dr.monitors.common.driver import MonitorBaseDriver
class DummyDriver(MonitorBaseDriver): class DummyDriver(MonitorBaseDriver):
@ -19,7 +19,7 @@ class DummyDriver(MonitorBaseDriver):
This can be useful for testing without actually shutting down the nodes. This can be useful for testing without actually shutting down the nodes.
The nodes that should be reported as failing, can be configured in the The nodes that should be reported as failing, can be configured in the
monitoring section of the osha configuration file as follows: monitoring section of the freezer_dr configuration file as follows:
kwargs = nodes_down:hostname1;hostname2 kwargs = nodes_down:hostname1;hostname2
""" """
@ -46,9 +46,7 @@ class DummyDriver(MonitorBaseDriver):
def get_info(self): def get_info(self):
return { return {
'name': 'Osha Dummy Driver', 'name': 'Freezer DR Dummy Driver',
'version': 1.0, 'version': 1.0,
'author': 'Hewlett-Packard Development Company, L.P' 'author': 'Hewlett-Packard Development Company, L.P'
} }

View File

View File

View File

View File

@ -13,8 +13,8 @@
# limitations under the License. # limitations under the License.
from oslo_config import cfg from oslo_config import cfg
from oslo_log import log from oslo_log import log
from osha.notifiers.common.driver import NotifierBaseDriver from freezer_dr.notifiers.common.driver import NotifierBaseDriver
from osha.common.utils import load_jinja_templates from freezer_dr.common.utils import load_jinja_templates
from datetime import date from datetime import date
import time import time
import smtplib import smtplib
@ -26,13 +26,14 @@ CONF = cfg.CONF
LOG = log.getLogger(__name__) LOG = log.getLogger(__name__)
class OshaEmail(NotifierBaseDriver): class StandardEmail(NotifierBaseDriver):
def __init__(self, url, username, password, templates_dir, notify_from, def __init__(self, url, username, password, templates_dir, notify_from,
admin_list=None, **kwargs): admin_list=None, **kwargs):
super(OshaEmail, self).__init__(url, username, password, templates_dir, super(StandardEmail, self).__init__(url, username, password,
notify_from, admin_list, **kwargs) templates_dir, notify_from,
LOG.info('Initializing OshaEmail driver @ {0}'.format(url)) admin_list, **kwargs)
LOG.info('Initializing StandardEmail driver @ {0}'.format(url))
server = smtplib.SMTP(url, kwargs.get('port')) server = smtplib.SMTP(url, kwargs.get('port'))
server.ehlo() server.ehlo()
if kwargs.get('tls'): if kwargs.get('tls'):

View File

@ -1,15 +0,0 @@
"""Common module for osha."""
# (c) Copyright 2016 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

View File

@ -1,13 +0,0 @@
# (c) Copyright 2014,2015 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

View File

@ -1,13 +0,0 @@
# (c) Copyright 2014,2015 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

View File

@ -1 +0,0 @@
__author__ = 'saad'

View File

@ -1 +0,0 @@
__author__ = 'saad'

View File

@ -1 +0,0 @@
__author__ = 'saad'

View File

@ -1 +0,0 @@
__author__ = 'saad'

View File

@ -1 +0,0 @@
__author__ = 'saad'

View File

@ -1 +0,0 @@
__author__ = 'saad'

View File

@ -1 +0,0 @@
__author__ = 'saad'

View File

@ -1,13 +0,0 @@
# (c) Copyright 2014,2015 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

View File

@ -1 +0,0 @@
__author__ = 'saad'

View File

@ -1 +0,0 @@
__author__ = 'saad'

View File

@ -1 +0,0 @@
__author__ = 'saad'

View File

@ -1,13 +0,0 @@
# (c) Copyright 2014,2015 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

View File

@ -1,13 +0,0 @@
# (c) Copyright 2014,2015 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

View File

@ -1,13 +0,0 @@
# (c) Copyright 2014,2015 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

View File

@ -1,13 +0,0 @@
# (c) Copyright 2014,2015 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

View File

@ -1,7 +1,7 @@
[metadata] [metadata]
name = Osha name = Freezer DR
version = 0.1 version = 0.1
summary = OpenStack Compute High Availability summary = OpenStack Disaster Recovery
description-file = description-file =
README.rst README.rst
author = OpenStack author = OpenStack
@ -19,7 +19,7 @@ classifier =
[files] [files]
packages = packages =
osha freezer_dr
[global] [global]
setup-hooks = setup-hooks =
@ -32,6 +32,6 @@ warnerrors = True
[entry_points] [entry_points]
oslo.config.opts = oslo.config.opts =
osha = osha.common.config:list_opts freezer-dr = freezer_dr.common.config:list_opts
console_scripts = console_scripts =
osha = osha.main:main freezer-dr = freezer_dr.main:main