← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~pappacena/turnip:py3-str-metric-name into turnip:master

 

Thiago F. Pappacena has proposed merging ~pappacena/turnip:py3-str-metric-name into turnip:master.

Commit message:
Converting repo name to string before transforming it to metric name with re.sub

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~pappacena/turnip/+git/turnip/+merge/393766
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~pappacena/turnip:py3-str-metric-name into turnip:master.
diff --git a/turnip/pack/git.py b/turnip/pack/git.py
index fea0043..5f9dde4 100644
--- a/turnip/pack/git.py
+++ b/turnip/pack/git.py
@@ -325,8 +325,9 @@ class GitProcessProtocol(protocol.ProcessProtocol, object):
             else:
                 # remove characters from repository name that
                 # can't be used in statsd
-                repository = re.sub('[^0-9a-zA-Z]+', '-',
-                                    self.peer.raw_pathname)
+                repository = re.sub(
+                    '[^0-9a-zA-Z]+', '-',
+                    six.ensure_text(self.peer.raw_pathname))
                 environment = config.get("statsd_environment")
                 gauge_name = (
                     "git,operation={},repo={},env={},metric=max_rss"

References