Skip to content

Commit

Permalink
added python 3.5 support
Browse files Browse the repository at this point in the history
  • Loading branch information
kingmray committed Mar 2, 2016
1 parent 1d25fba commit a98bca6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
language: python
python:
- "2.7"
- "3.5"

# command to install dependencies
install:
Expand Down
9 changes: 6 additions & 3 deletions jiraGitHook/jiraGitHook.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ def get_username(self, g):

return email

def stringToBase64(self, s):
return base64.b64encode(s.encode('utf-8'))

def get_auth(self, username, paswd):
base64string = base64.encodestring('%s:%s' % (username, paswd)).replace('\n', '')
base64string = self.stringToBase64(('%s:%s' % (username, paswd)).replace('\n', ''))

return "Basic %s" % (base64string)

Expand Down Expand Up @@ -120,7 +123,7 @@ def git_hook(self, subject = None):
message = self.create_jira_message(g, gitlab_url, commit_hash, commit_message_body)
prepared_request = self.prepare_request(jira_url, message, auth_string)
# debug
print self.pretty_print_POST(prepared_request)
print (self.pretty_print_POST(prepared_request))
return self.send_commit_message_to_jira(prepared_request)

return "no ticket id found!"
return ("no ticket id found!")

0 comments on commit a98bca6

Please sign in to comment.