def waitForChassisIpToConnect(self, locationUrl): timeout = 60 for counter in range(1,timeout+1): response = self.get(self.httpHeader+locationUrl, ignoreError=True) self.logInfo('waitForChassisIpToConnect response: {}'.format(response.json())) if 'status' in response.json() and 'Request made on a locked resource' in response.json()['status']: self.logInfo('API server response: Request made on a locked resource. Retrying %s/%d secs' % (counter, timeout)) time.sleep(1) continue status = response.json()['isConnected'] self.logInfo('waitForChassisIpToConnect: Status: %s' % (status), timestamp=False) if status == False or status == None: self.logInfo('Wait %s/%d secs' % (counter, timeout), timestamp=False) time.sleep(1) if status == True: self.logInfo('Chassis is connected', timestamp=False) break if counter == timeout: if status == False or status == None: self.deleteSessionId() raise IxLoadRestApiException("Chassis failed to get connected")