Seems like that second one should be " .... self.codebases.get(codebase)" just in case it hadnt been set yet? Maybe not though. Just a thought.