remove extra item from listGroups and listProjects methods
On gerrit 2.4.x and gerrit 2.8 the list returned by the listGroups and listProjects methods always contains one extra item at the end of the list for example listGroups returns something like.. ['Administrators', 'Anonymous Users', 'Non-Interactive Users', 'Project Owners','Registered Users', ''] This change removes the last item from the returned list. Change-Id: I2af52a35ef5bc7fd300b12911fce18faab474222
This commit is contained in:
parent
ac865aa175
commit
8f24b9651c
|
@ -134,12 +134,12 @@ class Gerrit(object):
|
|||
def listProjects(self):
|
||||
cmd = 'gerrit ls-projects'
|
||||
out, err = self._ssh(cmd)
|
||||
return out.split('\n')
|
||||
return filter(None, out.split('\n'))
|
||||
|
||||
def listGroups(self):
|
||||
cmd = 'gerrit ls-groups'
|
||||
out, err = self._ssh(cmd)
|
||||
return out.split('\n')
|
||||
return filter(None, out.split('\n'))
|
||||
|
||||
def replicate(self, project='--all'):
|
||||
cmd = 'gerrit replicate %s' % project
|
||||
|
|
Loading…
Reference in New Issue