Permalink
Browse files

repo name not relevant in the debug message

  • Loading branch information...
1 parent 20b87a4 commit a5a42244c221468eba2e0e0c21b7fc709877b4bc @dr4Ke committed Sep 6, 2010
Showing with 8 additions and 12 deletions.
  1. +8 −12 0.11/tracgitosis/tracgitosis.py
@@ -86,12 +86,10 @@ def getsshkey(self, req, username):
This function read the file keydir/<user>.pub in the local gitosis-admin working tree.
"""
- repo = replace(os.path.basename(self.config.get('trac', 'repository_dir')), '.git', '')
- if repo != '':
- self.log.debug('get public key on repo: '+repo)
- result, message = gitpull(self.env.path+'/'+self.admrepo)
- if result != 0:
- add_warning('Admin repository update failed. Message: '+message)
+ self.log.debug('get ' + username + ' public key')
+ result, message = gitpull(self.env.path+'/'+self.admrepo)
+ if result != 0:
+ add_warning('Admin repository update failed. Message: '+message)
keyfile = self.env.path+'/'+self.admrepo+'/keydir/'+username+'.pub'
if os.path.exists(keyfile):
f = open(keyfile, 'r')
@@ -120,13 +118,11 @@ def setsshkey(self, req, username, key):
f = open(keyfile, 'w')
f.write(key+'\n')
f.close()
- repo = replace(os.path.basename(self.config.get('trac', 'repository_dir')), '.git', '')
tracname = self.config.get('project', 'name')
- if repo != '':
- self.log.debug('set public key on repo: '+repo)
- result, message = gitpull(self.env.path+'/'+self.admrepo)
- if result != 0:
- add_warning('Admin repository update failed. Message: '+message)
+ self.log.debug('set ' + username + ' public key')
+ result, message = gitpull(self.env.path+'/'+self.admrepo)
+ if result != 0:
+ add_warning('Admin repository update failed. Message: '+message)
status, message = gitcommit(self.env.path+'/'+self.admrepo, relkeyfile, tracname)
if status == 0:
add_notice(req, _('Your preferences have been saved.'))

0 comments on commit a5a4224

Please sign in to comment.