コード例 #1
0
    def ui_command_info(self):

        color = {
            "HEALTH_OK": "green",
            "HEALTH_WARN": "yellow",
            "HEALTH_ERR": "red"
        }

        status = self.ceph_status
        osdmap = status['osdmap']['osdmap']
        output = "Cluster name: {}\n".format(self.cluster_name)
        output += "Ceph version: {}\n".format(self.version)
        output += "Health      : {}\n".format(self.health_status)
        if self.health_status != 'HEALTH_OK':
            output += " - {}\n".format(','.join(self.health_list))

        mon_names = [mon.get('name') for mon in status["monmap"]["mons"]]

        q_str = "quorum {}".format(','.join(status['quorum_names']))
        q_out = set(mon_names) - set(status['quorum_names'])
        if q_out:
            q_str += ", out of quorum: {}".format(','.join(q_out))
        output += "\nMONs : {:>4} ({})\n".format(self.topology.num_mons, q_str)
        output += "OSDs : {:>4} ({} up, {} in)\n".format(
            self.topology.num_osds, osdmap['num_up_osds'],
            osdmap['num_in_osds'])
        output += "Pools: {:>4}\n".format(self.num_pools)
        raw = status['pgmap']['bytes_total']
        output += "Raw capacity: {}\n".format(human_size(raw))
        output += "\nConfig : {}\n".format(self.conf)
        output += "Keyring: {}\n".format(
            os.path.join(CephGroup.ceph_config_dir, self.keyring))

        console_message(output, color=color[self.health_status])
コード例 #2
0
ファイル: gateway.py プロジェクト: cephweiliu/ceph-iscsi
    def ui_command_info(self):
        '''
        List configured gateways.
        '''
        self.logger.debug("CMD: ../gateways/ info")

        for child in self.children:
            console_message(child)
コード例 #3
0
    def ui_command_info(self):
        """
        Show the attributes of the current object.
        """

        text = self.get_info()

        console_message(text)
コード例 #4
0
    def ui_command_info(self):
        """
        Generic handler showing the attributes of the current object
        :return: None
        """

        text = self.get_info()

        console_message(text)
コード例 #5
0
ファイル: storage.py プロジェクト: Fubo1/ceph-iscsi-cli
 def ui_command_info(self, image_id):
     """
     Provide disk configuration information (rbd and LIO details are
     provided)
     """
     self.logger.debug("CMD: /disks/ info {}".format(image_id))
     if image_id in self.disk_lookup:
         disk = self.disk_lookup[image_id]
         text = disk.get_info()
         console_message(text)
     else:
         self.logger.error("disk name provided does not exist")
コード例 #6
0
    def ui_command_info(self):
        self.logger.debug("CMD: info")

        if settings.config.trusted_ip_list:
            display_ips = ','.join(settings.config.trusted_ip_list)
        else:
            display_ips = 'None'

        console_message("HTTP mode          : {}".format(self.http_mode))
        console_message("Rest API port      : {}".format(settings.config.api_port))
        console_message("Local endpoint     : {}".format(self.local_api))
        console_message("Local Ceph Cluster : {}".format(settings.config.cluster_name))
        console_message("2ndary API IP's    : {}".format(display_ips))
コード例 #7
0
ファイル: ceph.py プロジェクト: ceph/ceph-iscsi
    def ui_command_info(self):

        color = {
            "HEALTH_OK": "green",
            "HEALTH_WARN": "yellow",
            "HEALTH_ERR": "red"
        }

        status = self.ceph_status
        # backward compatibility (< octopus)
        if 'osdmap' in status['osdmap']:
            osdmap = status['osdmap']['osdmap']
        else:
            osdmap = status['osdmap']
        output = "Cluster name: {}\n".format(self.cluster_name)
        output += "Ceph version: {}\n".format(self.version)
        output += "Health      : {}\n".format(self.health_status)
        if self.health_status != 'HEALTH_OK':
            output += " - {}\n".format(','.join(self.health_list))

        # backward compatibility (< octopus)
        if 'mons' in status['monmap']:
            num_mons = len(status['monmap']['mons'])
        else:
            num_mons = status['monmap']['num_mons']
        num_quorum = len(status['quorum_names'])
        num_out_of_quorum = num_mons - num_quorum
        q_str = "quorum {}, out of quorum: {}".format(num_quorum,
                                                      num_out_of_quorum)
        output += "\nMONs : {:>4} ({})\n".format(self.topology.num_mons, q_str)
        output += "OSDs : {:>4} ({} up, {} in)\n".format(
            self.topology.num_osds, osdmap['num_up_osds'],
            osdmap['num_in_osds'])
        output += "Pools: {:>4}\n".format(self.num_pools)
        raw = status['pgmap']['bytes_total']
        output += "Raw capacity: {}\n".format(human_size(raw))
        output += "\nConfig : {}\n".format(self.conf)
        output += "Client Name: {}\n".format(self.client_name)

        console_message(output, color=color[self.health_status])
コード例 #8
0
ファイル: gateway.py プロジェクト: lxbsz/ceph-iscsi-cli
    def ui_command_info(self):

        self.logger.debug("CMD: ../gateways/ info")

        for child in self.children:
            console_message(child)