Skip to content

Commit 31a11fd

Browse files
committed
update multiple args format to publish.runner, bump version
this was changed to yaml-style lists in salt 2014.7.3
1 parent 582a5f5 commit 31a11fd

3 files changed

Lines changed: 30 additions & 4 deletions

File tree

debian/changelog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
trebuchet-trigger (0.5.5-1) precise; urgency=low
2+
3+
* Update for yaml format args to publish.runner
4+
5+
-- Ariel T. Glenn <ariel@wikimedia.org> Sat, 09 May 2015 08:32:56 +0000
6+
17
trebuchet-trigger (0.5.4-1) precise; urgency=low
28

39
* Catch exception for config when not in repo

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515

1616
setup(
1717
name="TrebuchetTrigger",
18-
version="0.5.4",
18+
version="0.5.5",
1919
packages=find_packages(),
20-
install_requires=['GitPython>=0.3.2.RC1', 'PyYAML>=3.10', 'redis>=2.4.9'],
20+
install_requires=['GitPython>=0.3.2.RC1', 'PyYAML>=3.10', 'redis>=2.4.9', 'salt'],
2121

2222
author="Ryan Lane",
2323
author_email="ryan@ryandlane.com",

trigger/drivers/trebuchet/local.py

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919

2020
import redis
2121

22+
import salt.version
23+
2224
from datetime import datetime
2325
from trigger.drivers import SyncDriverError
2426
from trigger.drivers import LockDriverError
@@ -94,8 +96,17 @@ def _fetch(self, args):
9496
def _checkout(self, args):
9597
# TODO (ryan-lane): Check return values from these commands
9698
repo_name = self.conf.config['deploy.repo-name']
99+
if args.force:
100+
# see https://github.com/saltstack/salt/issues/18317
101+
_version_ = salt.version.SaltStackVersion(*salt.version.__version_info__)
102+
if (_version_ >= "2014.7.3"):
103+
runner_args = '[' + repo_name + ',' + str(args.force) + ']'
104+
else:
105+
runner_args = repo_name + ',' + str(args.force)
106+
else:
107+
runner_args = repo_name
97108
p = subprocess.Popen(['sudo','salt-call','-l','quiet','publish.runner',
98-
'deploy.checkout', repo_name+','+str(args.force)],
109+
'deploy.checkout', runner_args],
99110
stdout=subprocess.PIPE)
100111
p.communicate()
101112

@@ -206,9 +217,18 @@ def __init__(self, conf):
206217

207218
def restart(self, args):
208219
repo_name = self.conf.config['deploy.repo-name']
220+
if args.batch:
221+
# see https://github.com/saltstack/salt/issues/18317
222+
_version_ = salt.version.SaltStackVersion(*salt.version.__version_info__)
223+
if (_version_ >= "2014.7.3"):
224+
runner_args = '[' + repo_name + ',' + str(args.batch) + ']'
225+
else:
226+
runner_args = repo_name +',' + str(args.batch)
227+
else:
228+
runner_args = repo_name
209229
p = subprocess.Popen(['sudo','salt-call','-l','quiet','--out=json',
210230
'publish.runner','deploy.restart',
211-
repo_name+','+str(args.batch)],
231+
runner_args],
212232
stdout=subprocess.PIPE)
213233
out = p.communicate()[0]
214234
## Disabled until salt bug is fixed:

0 commit comments

Comments
 (0)