diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..d7e5447 --- /dev/null +++ b/AUTHORS @@ -0,0 +1,6 @@ +Jonas Pfannschmidt +Pierre-Arthur MATHIEU +Project Creator +Saad Zaher +Stefano Canepa +Zuul diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..8016615 --- /dev/null +++ b/ChangeLog @@ -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 diff --git a/HACKING.rst b/HACKING.rst index 007dd7a..51dca91 100644 --- a/HACKING.rst +++ b/HACKING.rst @@ -1,11 +1,11 @@ -Osha Style Commandments +Freezer DR Style Commandments =========================== - Step 1: Read the OpenStack Style Commandments http://docs.openstack.org/developer/hacking/ - Step 2: Read on -Osha Specific Commandments +Freezer DR Specific Commandments ------------------------------ Logging diff --git a/README.rst b/README.rst index 2811f37..8e6b4cd 100644 --- a/README.rst +++ b/README.rst @@ -1,14 +1,14 @@ ================== -OSHA +Freezer Disaster Recovery ================== -Osha, 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 -in one of the compute nodes osha will fence this compute node then osha will try to evacuate all -running instances on this compute node, finally Osha will notify all users who have workload/instances +freezer-dr, Openstack Compute node High Available provides compute node high availability for OpenStack. +Simply freezer-dr monitors all compute nodes running in a cloud deployment and if there is any failure +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 freezer-dr will notify all users who have workload/instances 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) 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 plugin or in future a combination of plugins if required -Osha 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. +freezer-dr should run in the control plane, however the architecture supports different scenarios. +For running freezer-dr under high availability mode, it should run with active passive mode. ----------------- How it works ----------------- -Starting Osha -1. Osha 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 ? -3.1. if no, Osha will exit displaying No failed nodes -3.2. if yes, Osha will call the fencing manager to fence the failed compute node +Starting freezer-dr +1. freezer-dr Monitoring manager is going to load the required monitoring driver according to the configuration +2. freezer-dr will query the monitoring system to check if it considers any compute nodes to be down ? +3.1. if no, freezer-dr will exit displaying No failed nodes +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 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 -7. Osha will evacuate all instances to another computes -8. Once the evacuation process completed, Osha will call the notification manager +6. freezer-dr will load the correct evacuation driver +7. freezer-dr will evacuate all instances to another computes +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 -10. Osha will start the notification process ... +10. freezer-dr will start the notification process ... diff --git a/config-generator/freezer-dr.conf b/config-generator/freezer-dr.conf new file mode 100644 index 0000000..8ccefe1 --- /dev/null +++ b/config-generator/freezer-dr.conf @@ -0,0 +1,5 @@ +[DEFAULT] +output_file = etc/freezer-dr.conf.sample +wrap_width = 79 +namespace = freezer-dr +namespace = oslo.log diff --git a/config-generator/osha.conf b/config-generator/osha.conf deleted file mode 100644 index 6622aa3..0000000 --- a/config-generator/osha.conf +++ /dev/null @@ -1,5 +0,0 @@ -[DEFAULT] -output_file = etc/osha.conf.sample -wrap_width = 79 -namespace = osha -namespace = oslo.log diff --git a/doc/osha_diagram.pdf b/doc/freezer_dr_diagram.pdf similarity index 100% rename from doc/osha_diagram.pdf rename to doc/freezer_dr_diagram.pdf diff --git a/doc/osha_diagram.xml b/doc/freezer_dr_diagram.xml similarity index 100% rename from doc/osha_diagram.xml rename to doc/freezer_dr_diagram.xml diff --git a/etc/osha.conf.sample b/etc/freezer-dr.conf.sample similarity index 93% rename from etc/osha.conf.sample rename to etc/freezer-dr.conf.sample index 17acd75..d36bed4 100644 --- a/etc/osha.conf.sample +++ b/etc/freezer-dr.conf.sample @@ -1,7 +1,7 @@ [DEFAULT] # -# From osha +# From freezer-dr # # Time to wait between different operations (integer value) @@ -94,12 +94,12 @@ [evacuation] # -# From osha +# From freezer-dr # # Time in seconds to wait between retries to disable compute node or put it in # 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 # maintenance mode. Default 10 seconds (integer value) @@ -118,7 +118,7 @@ [fencer] # -# From osha +# From freezer-dr # # YAML File contains the required credentials for compute nodes (string value) @@ -133,7 +133,7 @@ #hold_period = 10 # 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 # support these options. Options should be in key:value format (dict value) @@ -143,7 +143,7 @@ [keystone_authtoken] # -# From osha +# From freezer-dr # # Openstack auth URI i.e. http://controller:5000 (string value) @@ -188,11 +188,11 @@ [monitoring] # -# From osha +# From freezer-dr # # 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 = @@ -211,12 +211,12 @@ [notifiers] # -# From osha +# From freezer-dr # # Notification driver to load it to notify users if something went wrong # (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 # 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 # 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 # any special arguments for your driver. (dict value) #options = -# List of emails to sent them notification if something went wrong and Osha -# wasnot able to send an email to the tenant admin (list value) +# List of emails to sent them notification if something went wrong and Freezer +# DR wasnot able to send an email to the tenant admin (list value) #notify-list = # The sender address, it can be email address if we used default email driver, diff --git a/osha/__init__.py b/freezer_dr/__init__.py similarity index 87% rename from osha/__init__.py rename to freezer_dr/__init__.py index 6944b94..8ea7402 100644 --- a/osha/__init__.py +++ b/freezer_dr/__init__.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -# Osha Versions +# Freezer-DR Versions import pbr.version -__version__ = pbr.version.VersionInfo('osha').version_string() +__version__ = pbr.version.VersionInfo('freezer-dr').version_string() diff --git a/freezer_dr/common/__init__.py b/freezer_dr/common/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/osha/common/config.py b/freezer_dr/common/config.py similarity index 93% rename from osha/common/config.py rename to freezer_dr/common/config.py index 7d90add..34e7018 100644 --- a/osha/common/config.py +++ b/freezer_dr/common/config.py @@ -18,15 +18,17 @@ import sys from oslo_config import cfg from oslo_log import log -from osha import __version__ as OSHA_VERSION -from osha.common.utils import env +from freezer_dr import __version__ as FREEZER_DR_VERSION +from freezer_dr.common.utils import env CONF = cfg.CONF + _MONITORS = [ 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'), cfg.StrOpt('username', help='username to be used to initialize the monitoring driver'), @@ -61,7 +63,7 @@ _FENCER = [ 'reasonable amount of time as different servers take ' 'different times to shut off'), 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, ..'), cfg.DictOpt('options', default={}, @@ -113,8 +115,8 @@ _KEYSTONE_AUTH_TOKEN = [ _EVACUATION = [ cfg.StrOpt( 'driver', - default='osha.evacuators.drivers.osha.standard.' - 'OshaStandardEvacuator', + default='freezer_dr.evacuators.drivers.default.standard.' + 'StandardEvacuator', help='Time in seconds to wait between retries to disable compute' ' node or put it in maintenance mode. Default 10 seconds', dest='driver'), cfg.IntOpt( @@ -140,7 +142,8 @@ _EVACUATION = [ _NOTIFIERS = [ cfg.StrOpt('driver', - default='osha.notifiers.drivers.osha.default_email.OshaEmail', + default='freezer_dr.notifiers.drivers.default.default_email.' + 'StandardEmail', dest='driver', help='Notification driver to load it to notify users ' 'if something went wrong'), @@ -165,7 +168,7 @@ _NOTIFIERS = [ 'authentications comment or use None'), cfg.StrOpt('templates-dir', dest='templates-dir', - default='/etc/osha/templates', + default='/etc/freezer/templates', help='Path to Jinja2 templates directory that contains ' 'message templates'), cfg.DictOpt('options', @@ -178,7 +181,7 @@ _NOTIFIERS = [ default=[], dest='notify-list', 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'), cfg.StrOpt('notify-from', dest='notify-from', @@ -302,7 +305,7 @@ def configure(): CONF.register_group(notifiers_grp) CONF.register_opts(_NOTIFIERS, group='notifiers') - # Osha Auth + # Keystone Auth keystone_grp = cfg.OptGroup('keystone_authtoken', title='Keystone Auth Options', help='Openstack Credentials to call the nova ' @@ -310,13 +313,13 @@ def configure(): CONF.register_group(keystone_grp) 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) CONF(args=sys.argv[1:], - project='osha', + project='freezer', default_config_files=default_conf, - version=OSHA_VERSION) + version=FREEZER_DR_VERSION) def setup_logging(): @@ -326,7 +329,7 @@ def setup_logging(): 'iso8601=WARN', 'requests.packages.urllib3.connectionpool=WARN', 'urllib3.connectionpool=WARN', 'websocket=WARN', - 'keystonemiddleware=WARN', 'osha=INFO'] + 'keystonemiddleware=WARN', 'freezer-dr=INFO'] _DEFAULT_LOGGING_CONTEXT_FORMAT = ( '%(asctime)s.%(msecs)03d %(process)d ' @@ -334,7 +337,7 @@ def setup_logging(): '%(user_identity)s] %(instance)s' '%(message)s') 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(): diff --git a/osha/common/daemon.py b/freezer_dr/common/daemon.py similarity index 100% rename from osha/common/daemon.py rename to freezer_dr/common/daemon.py diff --git a/osha/common/osclient.py b/freezer_dr/common/osclient.py similarity index 100% rename from osha/common/osclient.py rename to freezer_dr/common/osclient.py diff --git a/osha/common/utils.py b/freezer_dr/common/utils.py similarity index 98% rename from osha/common/utils.py rename to freezer_dr/common/utils.py index 5de8f3b..abe69b6 100644 --- a/osha/common/utils.py +++ b/freezer_dr/common/utils.py @@ -19,7 +19,7 @@ import jinja2 from oslo_config import cfg from oslo_log import log -from osha.common.osclient import OSClient +from freezer_dr.common.osclient import OSClient CONF = cfg.CONF diff --git a/osha/common/yaml_parser.py b/freezer_dr/common/yaml_parser.py similarity index 100% rename from osha/common/yaml_parser.py rename to freezer_dr/common/yaml_parser.py diff --git a/freezer_dr/evacuators/__init__.py b/freezer_dr/evacuators/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/freezer_dr/evacuators/common/__init__.py b/freezer_dr/evacuators/common/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/osha/evacuators/common/driver.py b/freezer_dr/evacuators/common/driver.py similarity index 100% rename from osha/evacuators/common/driver.py rename to freezer_dr/evacuators/common/driver.py diff --git a/osha/evacuators/common/manager.py b/freezer_dr/evacuators/common/manager.py similarity index 96% rename from osha/evacuators/common/manager.py rename to freezer_dr/evacuators/common/manager.py index 4415bdc..7d72254 100644 --- a/osha/evacuators/common/manager.py +++ b/freezer_dr/evacuators/common/manager.py @@ -14,9 +14,9 @@ from oslo_config import cfg from oslo_log import log 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 osha.evacuators.common.utils import get_nodes_details +from freezer_dr.evacuators.common.utils import get_nodes_details CONF = cfg.CONF LOG = log.getLogger(__name__) diff --git a/osha/evacuators/common/utils.py b/freezer_dr/evacuators/common/utils.py similarity index 96% rename from osha/evacuators/common/utils.py rename to freezer_dr/evacuators/common/utils.py index 37a6eba..d85f464 100644 --- a/osha/evacuators/common/utils.py +++ b/freezer_dr/evacuators/common/utils.py @@ -11,7 +11,7 @@ # 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. -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): diff --git a/freezer_dr/evacuators/drivers/__init__.py b/freezer_dr/evacuators/drivers/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/freezer_dr/evacuators/drivers/default/__init__.py b/freezer_dr/evacuators/drivers/default/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/osha/evacuators/drivers/osha/standard.py b/freezer_dr/evacuators/drivers/default/standard.py similarity index 83% rename from osha/evacuators/drivers/osha/standard.py rename to freezer_dr/evacuators/drivers/default/standard.py index 15c9664..2ec83a4 100644 --- a/osha/evacuators/drivers/osha/standard.py +++ b/freezer_dr/evacuators/drivers/default/standard.py @@ -13,16 +13,16 @@ # limitations under the License. from oslo_config import cfg from oslo_log import log -from osha.evacuators.common.driver import EvacuatorBaseDriver -from osha.common.utils import get_os_client +from freezer_dr.evacuators.common.driver import EvacuatorBaseDriver +from freezer_dr.common.utils import get_os_client CONF = cfg.CONF LOG = log.getLogger(__name__) -class OshaStandardEvacuator(EvacuatorBaseDriver): +class StandardEvacuator(EvacuatorBaseDriver): 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() def get_node_instances(self, node): diff --git a/freezer_dr/evacuators/drivers/dummy/__init__.py b/freezer_dr/evacuators/drivers/dummy/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/osha/evacuators/drivers/dummy/dummy.py b/freezer_dr/evacuators/drivers/dummy/dummy.py similarity index 94% rename from osha/evacuators/drivers/dummy/dummy.py rename to freezer_dr/evacuators/drivers/dummy/dummy.py index 28eaa44..ff61afc 100644 --- a/osha/evacuators/drivers/dummy/dummy.py +++ b/freezer_dr/evacuators/drivers/dummy/dummy.py @@ -11,7 +11,7 @@ # 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. -from osha.evacuators.common.driver import EvacuatorBaseDriver +from freezer_dr.evacuators.common.driver import EvacuatorBaseDriver class DummyEvacuator(EvacuatorBaseDriver): diff --git a/osha/evacuators/common/__init__.py b/freezer_dr/fencers/__init__.py similarity index 100% rename from osha/evacuators/common/__init__.py rename to freezer_dr/fencers/__init__.py diff --git a/freezer_dr/fencers/common/__init__.py b/freezer_dr/fencers/common/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/osha/fencers/common/driver.py b/freezer_dr/fencers/common/driver.py similarity index 93% rename from osha/fencers/common/driver.py rename to freezer_dr/fencers/common/driver.py index 5e33893..568bb74 100644 --- a/osha/fencers/common/driver.py +++ b/freezer_dr/fencers/common/driver.py @@ -33,9 +33,9 @@ class FencerBaseDriver(object): Any fencer driver requires the following parameters to do the api 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 config option. """ diff --git a/osha/fencers/common/manager.py b/freezer_dr/fencers/common/manager.py similarity index 97% rename from osha/fencers/common/manager.py rename to freezer_dr/fencers/common/manager.py index 9d6c732..d04b87c 100644 --- a/osha/fencers/common/manager.py +++ b/freezer_dr/fencers/common/manager.py @@ -14,7 +14,7 @@ from oslo_config import cfg from oslo_log import log from oslo_utils import importutils -from osha.common.yaml_parser import YamlParser +from freezer_dr.common.yaml_parser import YamlParser from time import sleep CONF = cfg.CONF diff --git a/freezer_dr/fencers/drivers/__init__.py b/freezer_dr/fencers/drivers/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/freezer_dr/fencers/drivers/ipmi/__init__.py b/freezer_dr/fencers/drivers/ipmi/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/osha/fencers/drivers/ipmi/driver.py b/freezer_dr/fencers/drivers/ipmi/driver.py similarity index 92% rename from osha/fencers/drivers/ipmi/driver.py rename to freezer_dr/fencers/drivers/ipmi/driver.py index 3865a3f..43bb9b9 100644 --- a/osha/fencers/drivers/ipmi/driver.py +++ b/freezer_dr/fencers/drivers/ipmi/driver.py @@ -11,8 +11,8 @@ # 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. -from osha.fencers.common.driver import FencerBaseDriver -from osha.fencers.drivers.ipmi.ipmitool import IpmiInterface +from freezer_dr.fencers.common.driver import FencerBaseDriver +from freezer_dr.fencers.drivers.ipmi.ipmitool import IpmiInterface from oslo_log import log from oslo_config import cfg diff --git a/osha/fencers/drivers/ipmi/ipmitool.py b/freezer_dr/fencers/drivers/ipmi/ipmitool.py similarity index 100% rename from osha/fencers/drivers/ipmi/ipmitool.py rename to freezer_dr/fencers/drivers/ipmi/ipmitool.py diff --git a/freezer_dr/fencers/drivers/libvirt/__init__.py b/freezer_dr/fencers/drivers/libvirt/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/osha/fencers/drivers/libvirt/driver.py b/freezer_dr/fencers/drivers/libvirt/driver.py similarity index 96% rename from osha/fencers/drivers/libvirt/driver.py rename to freezer_dr/fencers/drivers/libvirt/driver.py index cd30a8d..d3e3cb5 100644 --- a/osha/fencers/drivers/libvirt/driver.py +++ b/freezer_dr/fencers/drivers/libvirt/driver.py @@ -11,7 +11,7 @@ # 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. -from osha.fencers.common.driver import FencerBaseDriver +from freezer_dr.fencers.common.driver import FencerBaseDriver from oslo_log import log from oslo_config import cfg import libvirt diff --git a/osha/main.py b/freezer_dr/main.py similarity index 83% rename from osha/main.py rename to freezer_dr/main.py index e46dfad..c521e1b 100644 --- a/osha/main.py +++ b/freezer_dr/main.py @@ -11,12 +11,12 @@ # 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. -from osha.common import config +from freezer_dr.common import config from oslo_config import cfg from oslo_log import log -from osha.monitors.common.manager import MonitorManager -from osha.evacuators.common.manager import EvacuationManager -from osha.notifiers.common.manager import NotificationManager +from freezer_dr.monitors.common.manager import MonitorManager +from freezer_dr.evacuators.common.manager import EvacuationManager +from freezer_dr.notifiers.common.manager import NotificationManager CONF = cfg.CONF LOG = log.getLogger(__name__) @@ -25,7 +25,7 @@ LOG = log.getLogger(__name__) def main(): config.configure() config.setup_logging() - LOG.info('Starting osha ... ') + LOG.info('Starting Freezer DR ... ') # load and initialize the monitoring driver monitor = MonitorManager() # Do the monitoring procedure diff --git a/freezer_dr/monitors/__init__.py b/freezer_dr/monitors/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/osha/monitors/common/__init__.py b/freezer_dr/monitors/common/__init__.py similarity index 100% rename from osha/monitors/common/__init__.py rename to freezer_dr/monitors/common/__init__.py diff --git a/osha/monitors/common/driver.py b/freezer_dr/monitors/common/driver.py similarity index 98% rename from osha/monitors/common/driver.py rename to freezer_dr/monitors/common/driver.py index 4ec16c3..9a6a584 100644 --- a/osha/monitors/common/driver.py +++ b/freezer_dr/monitors/common/driver.py @@ -27,7 +27,7 @@ class MonitorBaseDriver(object): """ Initializing the driver. Any monitoring system requires the following 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 password: Password :param endpoint: API URL diff --git a/osha/monitors/common/manager.py b/freezer_dr/monitors/common/manager.py similarity index 100% rename from osha/monitors/common/manager.py rename to freezer_dr/monitors/common/manager.py diff --git a/freezer_dr/monitors/drivers/__init__.py b/freezer_dr/monitors/drivers/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/freezer_dr/monitors/drivers/default/__init__.py b/freezer_dr/monitors/drivers/default/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/osha/monitors/drivers/osha/driver.py b/freezer_dr/monitors/drivers/default/driver.py similarity index 93% rename from osha/monitors/drivers/osha/driver.py rename to freezer_dr/monitors/drivers/default/driver.py index d980dd3..2efd9de 100644 --- a/osha/monitors/drivers/osha/driver.py +++ b/freezer_dr/monitors/drivers/default/driver.py @@ -11,8 +11,8 @@ # 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. -from osha.common.osclient import OSClient -from osha.monitors.common.driver import MonitorBaseDriver +from freezer_dr.common.osclient import OSClient +from freezer_dr.monitors.common.driver import MonitorBaseDriver from time import sleep from oslo_config import cfg from oslo_log import log @@ -23,10 +23,10 @@ CONF = cfg.CONF LOG = log.getLogger(__name__) -class OshaDriver(MonitorBaseDriver): +class StandardDriver(MonitorBaseDriver): 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( authurl=endpoint, username=username, @@ -97,12 +97,11 @@ class OshaDriver(MonitorBaseDriver): def get_info(self): return { - 'name': 'Osha Native Driver', + 'name': 'Freezer DR Native Driver', 'version': 1.0, 'author': 'Hewlett-Packard Development Company, L.P' } - def is_hpyervisor_down(self, hypervisors): down_hosts = [] for hypervisor in hypervisors: diff --git a/freezer_dr/monitors/drivers/dummy/__init__.py b/freezer_dr/monitors/drivers/dummy/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/osha/monitors/drivers/dummy/driver.py b/freezer_dr/monitors/drivers/dummy/driver.py similarity index 90% rename from osha/monitors/drivers/dummy/driver.py rename to freezer_dr/monitors/drivers/dummy/driver.py index a663f16..384f521 100644 --- a/osha/monitors/drivers/dummy/driver.py +++ b/freezer_dr/monitors/drivers/dummy/driver.py @@ -11,7 +11,7 @@ # 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. -from osha.monitors.common.driver import MonitorBaseDriver +from freezer_dr.monitors.common.driver import MonitorBaseDriver class DummyDriver(MonitorBaseDriver): @@ -19,7 +19,7 @@ class DummyDriver(MonitorBaseDriver): 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 - monitoring section of the osha configuration file as follows: + monitoring section of the freezer_dr configuration file as follows: kwargs = nodes_down:hostname1;hostname2 """ @@ -46,9 +46,7 @@ class DummyDriver(MonitorBaseDriver): def get_info(self): return { - 'name': 'Osha Dummy Driver', + 'name': 'Freezer DR Dummy Driver', 'version': 1.0, 'author': 'Hewlett-Packard Development Company, L.P' } - - diff --git a/freezer_dr/notifiers/__init__.py b/freezer_dr/notifiers/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/freezer_dr/notifiers/common/__init__.py b/freezer_dr/notifiers/common/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/osha/notifiers/common/driver.py b/freezer_dr/notifiers/common/driver.py similarity index 100% rename from osha/notifiers/common/driver.py rename to freezer_dr/notifiers/common/driver.py diff --git a/osha/notifiers/common/manager.py b/freezer_dr/notifiers/common/manager.py similarity index 100% rename from osha/notifiers/common/manager.py rename to freezer_dr/notifiers/common/manager.py diff --git a/freezer_dr/notifiers/drivers/__init__.py b/freezer_dr/notifiers/drivers/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/freezer_dr/notifiers/drivers/default/__init__.py b/freezer_dr/notifiers/drivers/default/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/osha/notifiers/drivers/osha/default_email.py b/freezer_dr/notifiers/drivers/default/default_email.py similarity index 89% rename from osha/notifiers/drivers/osha/default_email.py rename to freezer_dr/notifiers/drivers/default/default_email.py index 66a5e47..62b3d1d 100644 --- a/osha/notifiers/drivers/osha/default_email.py +++ b/freezer_dr/notifiers/drivers/default/default_email.py @@ -13,8 +13,8 @@ # limitations under the License. from oslo_config import cfg from oslo_log import log -from osha.notifiers.common.driver import NotifierBaseDriver -from osha.common.utils import load_jinja_templates +from freezer_dr.notifiers.common.driver import NotifierBaseDriver +from freezer_dr.common.utils import load_jinja_templates from datetime import date import time import smtplib @@ -26,13 +26,14 @@ CONF = cfg.CONF LOG = log.getLogger(__name__) -class OshaEmail(NotifierBaseDriver): +class StandardEmail(NotifierBaseDriver): def __init__(self, url, username, password, templates_dir, notify_from, admin_list=None, **kwargs): - super(OshaEmail, self).__init__(url, username, password, templates_dir, - notify_from, admin_list, **kwargs) - LOG.info('Initializing OshaEmail driver @ {0}'.format(url)) + super(StandardEmail, self).__init__(url, username, password, + templates_dir, notify_from, + admin_list, **kwargs) + LOG.info('Initializing StandardEmail driver @ {0}'.format(url)) server = smtplib.SMTP(url, kwargs.get('port')) server.ehlo() if kwargs.get('tls'): diff --git a/osha/common/__init__.py b/osha/common/__init__.py deleted file mode 100644 index 0db0533..0000000 --- a/osha/common/__init__.py +++ /dev/null @@ -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. diff --git a/osha/evacuators/__init__.py b/osha/evacuators/__init__.py deleted file mode 100644 index f7f293a..0000000 --- a/osha/evacuators/__init__.py +++ /dev/null @@ -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. diff --git a/osha/evacuators/drivers/__init__.py b/osha/evacuators/drivers/__init__.py deleted file mode 100644 index f7f293a..0000000 --- a/osha/evacuators/drivers/__init__.py +++ /dev/null @@ -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. diff --git a/osha/evacuators/drivers/dummy/__init__.py b/osha/evacuators/drivers/dummy/__init__.py deleted file mode 100644 index f920945..0000000 --- a/osha/evacuators/drivers/dummy/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__author__ = 'saad' diff --git a/osha/evacuators/drivers/osha/__init__.py b/osha/evacuators/drivers/osha/__init__.py deleted file mode 100644 index f920945..0000000 --- a/osha/evacuators/drivers/osha/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__author__ = 'saad' diff --git a/osha/fencers/__init__.py b/osha/fencers/__init__.py deleted file mode 100644 index f920945..0000000 --- a/osha/fencers/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__author__ = 'saad' diff --git a/osha/fencers/common/__init__.py b/osha/fencers/common/__init__.py deleted file mode 100644 index f920945..0000000 --- a/osha/fencers/common/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__author__ = 'saad' diff --git a/osha/fencers/drivers/__init__.py b/osha/fencers/drivers/__init__.py deleted file mode 100644 index f920945..0000000 --- a/osha/fencers/drivers/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__author__ = 'saad' diff --git a/osha/fencers/drivers/ipmi/__init__.py b/osha/fencers/drivers/ipmi/__init__.py deleted file mode 100644 index f920945..0000000 --- a/osha/fencers/drivers/ipmi/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__author__ = 'saad' diff --git a/osha/fencers/drivers/libvirt/__init__.py b/osha/fencers/drivers/libvirt/__init__.py deleted file mode 100644 index f920945..0000000 --- a/osha/fencers/drivers/libvirt/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__author__ = 'saad' diff --git a/osha/monitors/__init__.py b/osha/monitors/__init__.py deleted file mode 100644 index f7f293a..0000000 --- a/osha/monitors/__init__.py +++ /dev/null @@ -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. diff --git a/osha/monitors/drivers/__init__.py b/osha/monitors/drivers/__init__.py deleted file mode 100644 index f920945..0000000 --- a/osha/monitors/drivers/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__author__ = 'saad' diff --git a/osha/monitors/drivers/dummy/__init__.py b/osha/monitors/drivers/dummy/__init__.py deleted file mode 100644 index f920945..0000000 --- a/osha/monitors/drivers/dummy/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__author__ = 'saad' diff --git a/osha/monitors/drivers/osha/__init__.py b/osha/monitors/drivers/osha/__init__.py deleted file mode 100644 index f920945..0000000 --- a/osha/monitors/drivers/osha/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__author__ = 'saad' diff --git a/osha/notifiers/__init__.py b/osha/notifiers/__init__.py deleted file mode 100644 index f7f293a..0000000 --- a/osha/notifiers/__init__.py +++ /dev/null @@ -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. diff --git a/osha/notifiers/common/__init__.py b/osha/notifiers/common/__init__.py deleted file mode 100644 index f8c610d..0000000 --- a/osha/notifiers/common/__init__.py +++ /dev/null @@ -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. \ No newline at end of file diff --git a/osha/notifiers/drivers/__init__.py b/osha/notifiers/drivers/__init__.py deleted file mode 100644 index f7f293a..0000000 --- a/osha/notifiers/drivers/__init__.py +++ /dev/null @@ -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. diff --git a/osha/notifiers/drivers/osha/__init__.py b/osha/notifiers/drivers/osha/__init__.py deleted file mode 100644 index f7f293a..0000000 --- a/osha/notifiers/drivers/osha/__init__.py +++ /dev/null @@ -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. diff --git a/setup.cfg b/setup.cfg index 1ba9d41..a8af165 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,7 +1,7 @@ [metadata] -name = Osha +name = Freezer DR version = 0.1 -summary = OpenStack Compute High Availability +summary = OpenStack Disaster Recovery description-file = README.rst author = OpenStack @@ -19,7 +19,7 @@ classifier = [files] packages = - osha + freezer_dr [global] setup-hooks = @@ -32,6 +32,6 @@ warnerrors = True [entry_points] oslo.config.opts = - osha = osha.common.config:list_opts + freezer-dr = freezer_dr.common.config:list_opts console_scripts = - osha = osha.main:main \ No newline at end of file + freezer-dr = freezer_dr.main:main \ No newline at end of file