Improved outputs in lab pipelines

Change-Id: Id9a811da6d34dc74584dab72cc2a8441f24de2b5
diff --git a/cicd-lab-pipeline.groovy b/cicd-lab-pipeline.groovy
index 08b7527..972ab81 100644
--- a/cicd-lab-pipeline.groovy
+++ b/cicd-lab-pipeline.groovy
@@ -123,7 +123,7 @@
                 salt.enforceState(saltMaster, 'ci01*', 'glusterfs.server.setup', true)
                 sleep(5)
                 salt.enforceState(saltMaster, 'I@glusterfs:client', 'glusterfs.client', true)
-                print salt.cmdRun(saltMaster, 'I@glusterfs:client', 'mount|grep fuse.glusterfs || echo "Command failed"')
+                print common.prettyPrint(salt.cmdRun(saltMaster, 'I@glusterfs:client', 'mount|grep fuse.glusterfs || echo "Command failed"'))
             }
 
             stage("Deploy GlusterFS") {
@@ -137,14 +137,14 @@
                 salt.runSaltProcessStep(saltMaster, 'I@docker:swarm:role:master', 'mine.flush')
                 salt.runSaltProcessStep(saltMaster, 'I@docker:swarm:role:master', 'mine.update')
                 salt.enforceState(saltMaster, 'I@docker:swarm', 'docker.swarm', true)
-                print salt.cmdRun(saltMaster, 'I@docker:swarm:role:master', 'docker node ls')
+                print common.prettyPrint(salt.cmdRun(saltMaster, 'I@docker:swarm:role:master', 'docker node ls'))
             }
 
             stage("Deploy Docker services") {
                 salt.enforceState(saltMaster, 'I@docker:swarm:role:master', 'docker.client')
 
                 // XXX: Hack to fix dependency of gerrit on mysql
-                print salt.cmdRun(saltMaster, 'I@docker:swarm:role:master', "docker service rm gerrit; sleep 5; rm -rf /srv/volumes/gerrit/*")
+                print common.prettyPrint(salt.cmdRun(saltMaster, 'I@docker:swarm:role:master', "docker service rm gerrit; sleep 5; rm -rf /srv/volumes/gerrit/*"))
 
                 timeout(10) {
                     salt.cmdRun(saltMaster, 'I@docker:swarm:role:master', 'apt-get install -y mysql-client')
@@ -232,7 +232,7 @@
                         // TODO: fix salt.orchestrateSystem
                         // print salt.orchestrateSystem(saltMaster, ['expression': '*', 'type': 'compound'], 'sphinx.orch.generate_doc')
                         def out = salt.cmdRun(saltMaster, 'I@salt:master', 'salt-run state.orchestrate sphinx.orch.generate_doc || echo "Command execution failed"')
-                        print out
+                        print common.prettyPrint(out)
                         if (out =~ /Command execution failed/) {
                             throw new Exception("Command execution failed")
                         }
@@ -245,7 +245,7 @@
                 salt.enforceState(saltMaster, 'I@nginx:server', 'nginx')
 
                 def failedSvc = salt.cmdRun(saltMaster, '*', """systemctl --failed | grep -E 'loaded[ \t]+failed' && echo 'Command execution failed'""")
-                print failedSvc
+                print common.prettyPrint(failedSvc)
                 if (failedSvc =~ /Command execution failed/) {
                     common.errorMsg("Some services are not running. Environment may not be fully functional!")
                 }
diff --git a/lab-pipeline.groovy b/lab-pipeline.groovy
index 153fd14..a6efaca 100644
--- a/lab-pipeline.groovy
+++ b/lab-pipeline.groovy
@@ -486,7 +486,7 @@
                     //vip=$(salt-call pillar.data _param:stacklight_monitor_address --out key|grep _param: |awk '{print $2}')
                     //vip=${vip:=172.16.10.253}
                     def pillar = salt.getPillar(saltMaster, 'ctl01*', '_param:stacklight_monitor_address')
-                    print(pillar)
+                    print(common.prettyPrint(pillar))
                     def stacklight_vip = pillar['return'][0].values()[0]
 
                     if (stacklight_vip) {