Merge the tip of origin/release/proposed/2019.2.0 into origin/release/2019.2.0
8c27b53 refactor method for checking status of ceph cluster
b754a60 Update jcenter url in build.gradle
Change-Id: Ic69beb8dd2a3b65c31241d27fff1921d8991f7f5
diff --git a/build.gradle b/build.gradle
index c413b6f..96cb0ce 100644
--- a/build.gradle
+++ b/build.gradle
@@ -4,7 +4,7 @@
apply plugin: 'groovy'
apply plugin: 'codenarc'
-def jcenterRepo = System.getenv('ARTIFACTORY_URL') ?: 'https://artifactory.mcp.mirantis.net/jcenter'
+def jcenterRepo = System.getenv('ARTIFACTORY_URL') ?: 'https://artifactory.mcp.mirantis.net/artifactory/jcenter'
sourceSets {
main {
diff --git a/src/com/mirantis/mk/Ceph.groovy b/src/com/mirantis/mk/Ceph.groovy
index 72e644f..957b438 100644
--- a/src/com/mirantis/mk/Ceph.groovy
+++ b/src/com/mirantis/mk/Ceph.groovy
@@ -414,22 +414,43 @@
def common = new Common()
def count = 0
- def isHealthy = false
def health = ''
+ // warning that can appeared during operation while are unrelated to data safety
+ def acceptableWarnings = [
+ 'AUTH_INSECURE_GLOBAL_ID_RECLAIM',
+ 'AUTH_INSECURE_GLOBAL_ID_RECLAIM_ALLOWED',
+ 'MON_MSGR2_NOT_ENABLED'
+ ]
// wait for current ops will be reflected in status
sleep(5)
while(count++ < attempts) {
- health = cmdRun(master, 'ceph health', false)
- if(health == 'HEALTH_OK') { return }
- else {
- // HEALTH_WARN noout,norebalance flag(s) set
- def unexpectedFlags = health.tokenize(' ').getAt(1)?.tokenize(',')
+ health = cmdRun(master, 'ceph health -f json', false)
+ health = common.parseJSON(health)
+
+ if(health['status'] == 'HEALTH_OK') { return }
+ if(health['checks'].containsKey('OSDMAP_FLAGS')) {
+ def unexpectedFlags = health['checks']['OSDMAP_FLAGS']['summary']['message'].tokenize(' ').getAt(0)?.tokenize(',')
unexpectedFlags.removeAll(flags)
- if(health.contains('HEALTH_WARN') && unexpectedFlags.isEmpty()) { return }
+ if(unexpectedFlags.isEmpty()) {
+ health['checks'].remove('OSDMAP_FLAGS')
+ }
}
- common.warningMsg("Ceph cluster is still unhealthy: $health")
+
+ // ignore acceptable warnings
+ for(w in acceptableWarnings) {
+ if(health['checks'].containsKey(w)) {
+ health['checks'].remove(w)
+ }
+ }
+
+ if(health['checks'].isEmpty()) { return }
+
+ common.warningMsg("Ceph cluster is still unhealthy: " + health['status'])
+ for(check in health['checks']) {
+ common.warningMsg(check.value['summary']['message'])
+ }
sleep(10)
}
// TODO: MissingMethodException