Ryan Lane has submitted this change and it was merged.

Change subject: Suppress salt logging in cli operations
......................................................................


Suppress salt logging in cli operations

Change-Id: I2475194a2f27d2a3e8897863a894cb6b49809562
---
M manifests/role/deployment.pp
M modules/deployment/files/git-deploy/hooks/deploylib.py
M modules/deployment/files/git-deploy/utils/deploy-info
3 files changed, 17 insertions(+), 16 deletions(-)

Approvals:
  Ryan Lane: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/manifests/role/deployment.pp b/manifests/role/deployment.pp
index 7e91b3c..07227ce 100644
--- a/manifests/role/deployment.pp
+++ b/manifests/role/deployment.pp
@@ -243,9 +243,9 @@
   }
   sudo_group { "wikidev_deployment_server":
     privileges => [
-      "ALL = (root) NOPASSWD: /usr/bin/salt-call --out json pillar.data",
-      "ALL = (root) NOPASSWD: /usr/bin/salt-call publish.runner deploy.fetch 
*",
-      "ALL = (root) NOPASSWD: /usr/bin/salt-call publish.runner 
deploy.checkout *",
+      "ALL = (root) NOPASSWD: /usr/bin/salt-call -l quiet --out json 
pillar.data",
+      "ALL = (root) NOPASSWD: /usr/bin/salt-call -l quiet publish.runner 
deploy.fetch *",
+      "ALL = (root) NOPASSWD: /usr/bin/salt-call -l quiet publish.runner 
deploy.checkout *",
     ],
     group => "wikidev",
   }
@@ -270,9 +270,9 @@
   }
   sudo_group { "project_deployment_prep_deployment_server":
     privileges => [
-      "ALL = (root) NOPASSWD: /usr/bin/salt-call --out json pillar.data",
-      "ALL = (root) NOPASSWD: /usr/bin/salt-call publish.runner deploy.fetch 
*",
-      "ALL = (root) NOPASSWD: /usr/bin/salt-call publish.runner 
deploy.checkout *",
+      "ALL = (root) NOPASSWD: /usr/bin/salt-call -l quiet --out json 
pillar.data",
+      "ALL = (root) NOPASSWD: /usr/bin/salt-call -l quiet publish.runner 
deploy.fetch *",
+      "ALL = (root) NOPASSWD: /usr/bin/salt-call -l quiet publish.runner 
deploy.checkout *",
     ],
     group => "project-deployment-prep",
   }
diff --git a/modules/deployment/files/git-deploy/hooks/deploylib.py 
b/modules/deployment/files/git-deploy/hooks/deploylib.py
index da6cb18..7d64fd7 100755
--- a/modules/deployment/files/git-deploy/hooks/deploylib.py
+++ b/modules/deployment/files/git-deploy/hooks/deploylib.py
@@ -6,8 +6,8 @@
 
 
 def update_repos(prefix, tag):
-    print "Running: sudo salt-call --out json pillar.data"
-    p = subprocess.Popen("sudo salt-call --out json pillar.data",
+    print "Running: sudo salt-call -l quiet --out json pillar.data"
+    p = subprocess.Popen("sudo salt-call -l quiet --out json pillar.data",
                          shell=True, stdout=subprocess.PIPE,
                          stderr=subprocess.PIPE)
     out = p.communicate()[0]
@@ -17,7 +17,6 @@
         print ("JSON data wasn't loaded from the pillar call. "
                "git-deploy can't configure itself. Exiting.")
         return 1
-
     try:
         repodir = pillar['repo_locations'][prefix]
     except KeyError:
@@ -70,16 +69,18 @@
 
 
 def fetch(prefix):
-    print "Running: sudo salt-call publish.runner deploy.fetch '%s'" % (prefix)
-    p = subprocess.Popen("sudo salt-call publish.runner deploy.fetch '%s'" %
-                         (prefix), shell=True, stdout=subprocess.PIPE)
+    print ("Running: sudo salt-call -l quiet publish.runner "
+           "deploy.fetch '%s'" % (prefix))
+    p = subprocess.Popen("sudo salt-call -l quiet publish.runner "
+                         "deploy.fetch '%s'" % (prefix), shell=True,
+                         stdout=subprocess.PIPE)
     out = p.communicate()[0]
 
 
 def checkout(prefix, force):
-    print ("Running: sudo salt-call publish.runner deploy.checkout '%s,%s'" %
-           (prefix, force))
-    p = subprocess.Popen("sudo salt-call publish.runner "
+    print ("Running: sudo salt-call -l quiet publish.runner "
+           "deploy.checkout '%s,%s'" % (prefix, force))
+    p = subprocess.Popen("sudo salt-call -l quiet publish.runner "
                          "deploy.checkout '%s,%s'" % (prefix, force),
                          shell=True, stdout=subprocess.PIPE)
     out = p.communicate()[0]
diff --git a/modules/deployment/files/git-deploy/utils/deploy-info 
b/modules/deployment/files/git-deploy/utils/deploy-info
index 5aa3293..a858ebf 100644
--- a/modules/deployment/files/git-deploy/utils/deploy-info
+++ b/modules/deployment/files/git-deploy/utils/deploy-info
@@ -20,7 +20,7 @@
     parser.add_option("--full-report", action="store_true", dest="fullreport", 
default=False, help="Show a full report of the state of the requested repo, or 
all repos")
     (options, args) = parser.parse_args()
     serv = redis.Redis(host='localhost', port=6379, db=0)
-    p = subprocess.Popen("sudo salt-call --out json pillar.data", shell=True, 
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+    p = subprocess.Popen("sudo salt-call -l quiet --out json pillar.data", 
shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
     out = p.communicate()[0]
     try:   
         pillar = json.loads(out)

-- 
To view, visit https://gerrit.wikimedia.org/r/67362
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I2475194a2f27d2a3e8897863a894cb6b49809562
Gerrit-PatchSet: 4
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ryan Lane <[email protected]>
Gerrit-Reviewer: Ryan Lane <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to