def get_status(self): status = False try: self.get_flavors_list() status = True LOG.info("Nova connection is established") except Exception as e: LOG.error("Couldn't connect to Nova client " + e) return status
def get_status(self): status = False try: self.get_image_list() status = True LOG.info("Glance connection is established") except Exception as e: LOG.error("Couldn't connect to Glance client " + e) return status
def get_best_flavor(self, values): LOG.info("Getting the best flavor for virtual machine") best_list = self.get_flavor_map() for i in range(len(values)): initial_list = best_list best_list = {} for flavor in initial_list: if initial_list[flavor][i] >= values[i]: best_list[flavor] = initial_list[flavor] if not best_list: LOG.error("No flavors matched") return get_smallest_flavor(best_list)