def run_checks(self): """Check for any remaining unverified floating IPs Gets VM details from nova and checks for floating IPs within the returned information. Returns true when all checks are complete and is suitable for use with tempest.test.call_until_true() """ to_delete = [] loggable_map = {} for check_addr, server in self.unchecked.iteritems(): serverdata = self.compute_client.servers.get(server.id) ip_addr = [addr for sublist in serverdata.networks.values() for addr in sublist] if check_addr.floating_ip_address in ip_addr: to_delete.append(check_addr) else: loggable_map[server.id] = check_addr for to_del in to_delete: del self.unchecked[to_del] LOG.debug('Unchecked floating IPs: %s', jsonutils.dumps(loggable_map)) return len(self.unchecked) == 0
def format(self, record): message = {'message': record.getMessage(), 'asctime': self.formatTime(record, self.datefmt), 'name': record.name, 'msg': record.msg, 'args': record.args, 'levelname': record.levelname, 'levelno': record.levelno, 'pathname': record.pathname, 'filename': record.filename, 'module': record.module, 'lineno': record.lineno, 'funcname': record.funcName, 'created': record.created, 'msecs': record.msecs, 'relative_created': record.relativeCreated, 'thread': record.thread, 'thread_name': record.threadName, 'process_name': record.processName, 'process': record.process, 'traceback': None} if hasattr(record, 'extra'): message['extra'] = record.extra if record.exc_info: message['traceback'] = self.formatException(record.exc_info) return jsonutils.dumps(message)
def update_quota_set(self, tenant_id, gigabytes=None, volumes=None, snapshots=None): post_body = {} if gigabytes is not None: post_body['gigabytes'] = gigabytes if volumes is not None: post_body['volumes'] = volumes if snapshots is not None: post_body['snapshots'] = snapshots post_body = jsonutils.dumps({'quota_set': post_body}) resp, body = self.put('os-quota-sets/%s' % tenant_id, post_body) return resp, self._parse_resp(body)
def update_quota_set(self, tenant_id, gigabytes=None, volumes=None, snapshots=None): post_body = {} if gigabytes is not None: post_body['gigabytes'] = gigabytes if volumes is not None: post_body['volumes'] = volumes if snapshots is not None: post_body['snapshots'] = snapshots post_body = jsonutils.dumps({'quota_set': post_body}) resp, body = self.put('os-quota-sets/%s' % tenant_id, post_body) self.expected_success(200, resp.status) return resp, self._parse_resp(body)
def update_quota_set(self, tenant_id, gigabytes=None, volumes=None, snapshots=None): post_body = {} if gigabytes is not None: post_body['gigabytes'] = gigabytes if volumes is not None: post_body['volumes'] = volumes if snapshots is not None: post_body['snapshots'] = snapshots post_body = jsonutils.dumps({'quota_set': post_body}) resp, body = self.put('os-quota-sets/%s' % tenant_id, post_body) self.expected_success(200, resp.status) return service_client.ResponseBody(resp, self._parse_resp(body))
def serialize(self, body): return json.dumps(body)