summaryrefslogtreecommitdiff
diff options
authorMario Splivalo <mario.splivalo@canonical.com>2018-04-25 17:10:50 +0200
committerMario Splivalo <mario.splivalo@canonical.com>2018-04-25 17:10:50 +0200
commit4591c31f84f6f55690ff5184faafff0e5ed74d02 (patch)
tree5c9abcc70c6963faee0f6b6352eca15cd19f6ca5
parent20aaba6374ed0b6a5263147ad86481738073112c (diff)
Ignoring obsolete mongodb options for mongo3.6
-rwxr-xr-xhooks/hooks.py50
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":