Ryan Lane has submitted this change and it was merged.
Change subject: git-deploy updates for salt upgrade
......................................................................
git-deploy updates for salt upgrade
Change-Id: I80aca184c1312a1cf03815cf79538e9a65ace0a9
---
M modules/deployment/files/git-deploy/hooks/deploylib.py
M modules/deployment/files/git-deploy/utils/deploy-info
M modules/deployment/files/modules/deploy.py
3 files changed, 5 insertions(+), 15 deletions(-)
Approvals:
Ryan Lane: Verified; Looks good to me, approved
diff --git a/modules/deployment/files/git-deploy/hooks/deploylib.py
b/modules/deployment/files/git-deploy/hooks/deploylib.py
index fa498b2..1ddc633 100755
--- a/modules/deployment/files/git-deploy/hooks/deploylib.py
+++ b/modules/deployment/files/git-deploy/hooks/deploylib.py
@@ -14,11 +14,6 @@
except ValueError:
print "JSON data wasn't loaded from the pillar call. git-deploy
can't configure itself. Exiting."
return 1
- try:
- pillar = pillar['local']
- except KeyError:
- print "Couldn't find 'local' in json output from pillar data.
git-deploy can't configure itself. Exiting."
- return 1
try:
repodir = pillar['repo_locations'][prefix]
diff --git a/modules/deployment/files/git-deploy/utils/deploy-info
b/modules/deployment/files/git-deploy/utils/deploy-info
index 9815bc5..5aa3293 100644
--- a/modules/deployment/files/git-deploy/utils/deploy-info
+++ b/modules/deployment/files/git-deploy/utils/deploy-info
@@ -27,11 +27,6 @@
except ValueError:
print "JSON data wasn't loaded from the pillar call. git-deploy can't
configure itself. Exiting."
return None
- try:
- pillar = pillar['local']
- except KeyError:
- print "Couldn't find 'local' in json output from pillar data.
git-deploy can't configure itself. Exiting."
- return None
repos = serv.smembers('deploy:repos')
if options.repo:
if options.repo not in repos:
diff --git a/modules/deployment/files/modules/deploy.py
b/modules/deployment/files/modules/deploy.py
index 95ea1a1..ab7cf45 100644
--- a/modules/deployment/files/modules/deploy.py
+++ b/modules/deployment/files/modules/deploy.py
@@ -22,7 +22,7 @@
def _check_in(function, repo):
serv = _get_serv()
- minion = __salt__['grains.item']('id')
+ minion = __grains__.get('id')
timestamp = time.time()
# Ensure this repo exist in the set of repos
serv.sadd('deploy:repos', repo)
@@ -44,13 +44,13 @@
'''
repourls = __pillar__.get('repo_urls')
minion_regexes = __pillar__.get('repo_minion_regex')
- site = __salt__['grains.item']('site')
+ site = __grains__.get('site')
repourls = repourls[site]
repolocs = __pillar__.get('repo_locations')
status = 0
stats = {}
- minion = __grains__.get('id', '')
+ minion = __grains__.get('id')
for repo,repourl in repourls.items():
minion_regex = minion_regexes[repo]
if not re.search(minion_regex,minion):
@@ -72,7 +72,7 @@
salt -G 'cluster:appservers' deploy.fetch 'slot0'
'''
- site = __salt__['grains.item']('site')
+ site = __grains__.get('site')
repourls = __pillar__.get('repo_urls')
repourls = repourls[site]
repourl = repourls[repo]
@@ -164,7 +164,7 @@
salt -G 'cluster:appservers' deploy.checkout 'slot0'
'''
#TODO: replace the cmd.retcode calls with git module calls, where
appropriate
- site = __salt__['grains.item']('site')
+ site = __grains__.get('site')
repourls = __pillar__.get('repo_urls')
repourls = repourls[site]
repourl = repourls[repo]
--
To view, visit https://gerrit.wikimedia.org/r/67337
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I80aca184c1312a1cf03815cf79538e9a65ace0a9
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ryan Lane <[email protected]>
Gerrit-Reviewer: Ryan Lane <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits