Add check for pg ready before generate mapping when adding ceph node

Change-Id: I9f3c3bb305dd5fe6c001260100690644649be2f5
Related-Prod: PROD-36131
diff --git a/ceph-add-node.groovy b/ceph-add-node.groovy
index 9ef1f88..d1315b2 100644
--- a/ceph-add-node.groovy
+++ b/ceph-add-node.groovy
@@ -125,11 +125,13 @@
                         if (pgmap.trim()) {
                             pgmap = "{\"pgs\":$pgmap}" // common.parseJSON() can't parse a list of maps
                             pgmap = common.parseJSON(pgmap)['pgs']
-                            ceph.generateMapping(pgmap, mapping)
-                            for(map in mapping) {
-                                ceph.cmdRun(pepperEnv, map)
+                            if (!pgmap.get('pg_ready', false)) {
+                                ceph.generateMapping(pgmap, mapping)
+                                for(map in mapping) {
+                                    ceph.cmdRun(pepperEnv, map)
+                                }
+                                sleep(30)
                             }
-                            sleep(30)
                         }
                     }
                 }