def Exec(self, feedback_fn):
    node_uuid = self.instance.primary_node

    cluster_hvparams = self.cfg.GetClusterInfo().hvparams
    node_insts = self.rpc.call_instance_list(
                   [node_uuid], [self.instance.hypervisor],
                   cluster_hvparams)[node_uuid]
    node_insts.Raise("Can't get node information from %s" %
                     self.cfg.GetNodeName(node_uuid))

    if self.instance.name not in node_insts.payload:
      if self.instance.admin_state == constants.ADMINST_UP:
        state = constants.INSTST_ERRORDOWN
      elif self.instance.admin_state == constants.ADMINST_DOWN:
        state = constants.INSTST_ADMINDOWN
      else:
        state = constants.INSTST_ADMINOFFLINE
      raise errors.OpExecError("Instance %s is not running (state %s)" %
                               (self.instance.name, state))

    logging.debug("Connecting to console of %s on %s", self.instance.name,
                  self.cfg.GetNodeName(node_uuid))

    node = self.cfg.GetNodeInfo(self.instance.primary_node)
    group = self.cfg.GetNodeGroup(node.group)
    return GetInstanceConsole(self.cfg.GetClusterInfo(),
                              self.instance, node, group)
Returns the Database object for this hook.
dataset/ETHPy150Open ganeti/ganeti/lib/cmdlib/instance_operation.py/LUInstanceConsole.Exec--crossover with--dataset/ETHPy150Open airbnb/airflow/airflow/contrib/hooks/cloudant_hook.py/CloudantHook.db