def test(self): poolmgr=poolManager() print poolmgr #poolmgr.addToPool(self.hostInfo) hostinfo=poolmgr.findSutableHost("dummby","bharat") print "hostinfo", hostinfo poolmgr.free(hostinfo) poolmgr.update(hostinfo['id'],"state","free") poolmgr.remove(hostinfo['id'])
g.updatePr(prToTest) prToTest = None else: break else: pr = inp_dict["buildFromPr"] pr = pr.split(":") prToTest = g.findPrByNumber(pr[0], pr[1]) if prToTest is None: logging.info("Found no pr to test") sys.exit(0) githubPrno = long(prToTest["pr_no"]) try: poolmgr = poolManager() hostmgr = hostManager() mgmtHostInfo = poolmgr.findSutableHost(inp_dict["repo_url"], inp_dict["profile"], inp_dict["configName"]) if mgmtHostInfo != None and inp_dict["destroy"]: poolmgr.destroy(mgmtHostInfo["hostname"]) mgmtHostInfo = None if mgmtHostInfo is None: mgmtHostInfo = hostmgr.create( inp_dict["repo_url"], inp_dict["branch"], githubPrno, inp_dict["commit"], inp_dict["configName"], inp_dict["profile"],