diff options
-rwxr-xr-x | hooks/hooks.py | 50 |
1 files changed, 35 insertions, 15 deletions
diff --git a/hooks/hooks.py b/hooks/hooks.py index 5e00355..6af2eec 100755 --- a/hooks/hooks.py +++ b/hooks/hooks.py @@ -293,32 +293,49 @@ def mongodb_conf(config_data=None): # objcheck if config_data['objcheck']: - config.append("objcheck = true") - config.append("") + if lsb_release()['DISTRIB_RELEASE'] < '18.04': + config.append("objcheck = true") + config.append("") + else: + juju_log('Deprecated option objcheck is ignored on bionic!', 'WARN') # quota if config_data['quota']: config.append("quota = true") config.append("") - # diaglog - config.append("diaglog = %d" % config_data['diaglog']) - config.append("") + # diaglog (only set for mongodb < 3.6, 3.6 is included in bionic) + if lsb_release()['DISTRIB_RELEASE'] < '18.04': + config.append("diaglog = %d" % config_data['diaglog']) + config.append("") + else: + juju_log('Deprecated option diaglog is ignored on bionic!', 'WARN') # nocursors if config_data['nocursors']: - config.append("nocursors = true") - config.append("") + if lsb_release()['DISTRIB_RELEASE'] < '18.04': + config.append("nocursors = true") + config.append("") + else: + juju_log('Deprecated option nocursors is ignored on bionic!', + 'WARN') # nohints if config_data['nohints']: - config.append("nohints = true") - config.append("") - - # nohttpinterface + if lsb_release()['DISTRIB_RELEASE'] < '18.04': + config.append("nohints = true") + config.append("") + else: + juju_log('Deprecated option nohints is ignored on bionic!', 'WARN') + + # nohttpinterface if config_data['web_admin_ui']: - config.append("rest = true") - config.append("") + if lsb_release()['DISTRIB_RELEASE'] < '18.04': + config.append("rest = true") + config.append("") + else: + juju_log('Deprecated option web_admin_ui is ignored on bionic!', + 'WARN') # noscripting if config_data['noscripting']: @@ -391,8 +408,11 @@ def mongodb_conf(config_data=None): # opIdMem if config_data['opIdMem'] != "default": - config.append("opIdMem = %s" % config_data['opIdMem']) - config.append("") + if lsb_release()['DISTRIB_RELEASE'] < '18.04': + config.append("opIdMem = %s" % config_data['opIdMem']) + config.append("") + else: + juju_log('Deprecated option opIdMem is ignored on bionic!', 'WARN') # extra config options if config_data['extra_config_options'] != "none": |