Merge "Replace notification.conf with monasca-notification.conf"
This commit is contained in:
commit
5f21b325ba
|
@ -12,7 +12,9 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log
|
||||
import sys
|
||||
import yaml
|
||||
|
||||
from monasca_notification import conf
|
||||
|
@ -39,8 +41,9 @@ def parse_args(argv, no_yaml=False):
|
|||
|
||||
CONF(args=argv,
|
||||
project='monasca',
|
||||
prog='notification',
|
||||
prog=sys.argv[1:],
|
||||
version=version.version_string,
|
||||
default_config_files=_get_config_files(),
|
||||
description='''
|
||||
monasca-notification is an engine responsible for
|
||||
transforming alarm transitions into proper notifications
|
||||
|
@ -60,6 +63,25 @@ def parse_args(argv, no_yaml=False):
|
|||
_CONF_LOADED = True
|
||||
|
||||
|
||||
def _get_config_files():
|
||||
"""Get the possible configuration files accepted by oslo.config
|
||||
|
||||
This also includes the deprecated ones
|
||||
"""
|
||||
# default files
|
||||
conf_files = cfg.find_config_files(project='monasca',
|
||||
prog='monasca-notification')
|
||||
# deprecated config files (only used if standard config files are not there)
|
||||
if len(conf_files) == 0:
|
||||
old_conf_files = cfg.find_config_files(project='monasca',
|
||||
prog='notification')
|
||||
if len(old_conf_files) > 0:
|
||||
LOG.warning('Found deprecated old location "{}" '
|
||||
'of main configuration file'.format(old_conf_files))
|
||||
conf_files += old_conf_files
|
||||
return conf_files
|
||||
|
||||
|
||||
def set_from_yaml():
|
||||
if CONF.yaml_config:
|
||||
LOG.info('Detected usage of deprecated YAML configuration')
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
deprecations:
|
||||
- |
|
||||
Configuration file path /etc/monasca/notification.conf is deprecated.
|
||||
Use the standard path /etc/monasca/monasca-notification.conf or the
|
||||
configuration dir (supported via oslo.config)
|
||||
/etc/monasca/monasca-notification.conf.d/any_config_name.conf
|
Loading…
Reference in New Issue