Pass source to project instantiations
So that we can store the canonical hostname. Also use this to find and store the connection name to keep the initializer signature small. Story: 2000953 Change-Id: Ie10f86ff3412016b411bcc511b4d9ad3af163d61
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
|
||||
import logging
|
||||
from zuul.source import BaseSource
|
||||
from zuul.model import Project
|
||||
|
||||
|
||||
class GitSource(BaseSource):
|
||||
@@ -38,7 +39,11 @@ class GitSource(BaseSource):
|
||||
raise NotImplemented()
|
||||
|
||||
def getProject(self, name):
|
||||
return self.connection.getProject(name)
|
||||
p = self.connection.getProject(name)
|
||||
if not p:
|
||||
p = Project(name, self)
|
||||
self.connection.addProject(p)
|
||||
return p
|
||||
|
||||
def getProjectBranches(self, project):
|
||||
return self.connection.getProjectBranches(project)
|
||||
|
||||
Reference in New Issue
Block a user