grim/local-pipelines

2b2ae6db93c0
Merged in seanfarley/local-pipelines (pull request #7)

Fix python 3
--- a/pipelines/pipeline.py Thu Jul 28 15:14:47 2016 -0500
+++ b/pipelines/pipeline.py Thu Jul 28 17:25:53 2016 -0500
@@ -44,7 +44,7 @@
if "branches" in self.config["pipelines"]:
branches = self.config["pipelines"]["branches"]
- for pattern, steps in branches.iteritems():
+ for pattern, steps in branches.items():
if fnmatch.fnmatch(self.repo.branch, pattern):
ret = steps
break
@@ -54,12 +54,12 @@
@property
def public_env(self):
# dict of env vars that are not none
- return {k: v for k, v in self._env.iteritems() if v is not None}
+ return {k: v for k, v in self._env.items() if v is not None}
@property
def private_env(self):
# dict of env vars that are none (grabbed from os.environ)
- return {k: os.environ.get(k, "") for k, v in self._env.iteritems()
+ return {k: os.environ.get(k, "") for k, v in self._env.items()
if v is None}
def _determine_image(self, step):
@@ -91,7 +91,7 @@
"-w {}".format(workdir),
" ".join(["--label " + l for l in labels]),
" ".join(["-e {}={}".format(k, v) for k, v in
- self.public_env.iteritems()]),
+ self.public_env.items()]),
" ".join(["-e " + k for k in self.private_env.keys()]),
self._determine_image(step),
script,
--- a/pipelines/vcs.py Thu Jul 28 15:14:47 2016 -0500
+++ b/pipelines/vcs.py Thu Jul 28 17:25:53 2016 -0500
@@ -34,7 +34,7 @@
return subprocess.check_output(cmd.split(),
env=env,
stderr=open(os.devnull, 'w'),
- cwd=path).strip()
+ cwd=path).strip().decode('utf-8')
except subprocess.CalledProcessError:
return ''