Exemplo n.º 1
0
    def blade_select_changed(self):
        if len(self.treeWidget.selectedItems()) == 0:
            return
        selected_item = self.treeWidget.selectedItems()[0]
        cimc_ip = ""
        if selected_item.parent() == None:
            if selected_item.text(0) == get_message("new_input"):
                self.set_conn_info_input("", "", "")
                return
            else:
                cimc_ip = str(selected_item.text(0))
        else:
            cimc_ip = str(selected_item.parent().text(0))
        (conf_id, conf_pw, conf_type) = get_conf_info(cimc_ip)

        if selected_item.parent() == None:
            selected_item.takeChildren()
            # 선택한 샤시 정보 조회
            if blade_list.get(cimc_ip) == None:
                self.get_chassis_list(cimc_ip, conf_id, conf_pw)
            self.append_chassis(selected_item, cimc_ip)
            self.removeButton.setDisabled(False)
            self.connButton.setDisabled(True)
        else:
            chassis_info = blade_list[cimc_ip][str(selected_item.text(0))]
            (solt_status, availability, overall_status,
             discovery) = chassis_info
            self.set_chassis_detail(solt_status, availability, overall_status,
                                    discovery)
            self.removeButton.setDisabled(True)
            self.connButton.setDisabled(False)
        self.set_conn_info_input(cimc_ip, conf_id, conf_pw)
Exemplo n.º 2
0
 def refresh_blade_tree(self):
     self.treeWidget.clear()
     for conf_ip in get_ip_list():
         (conf_id, conf_pw, conf_type) = get_conf_info(conf_ip)
         if conf_type == "blade":
             item = QTreeWidgetItem(self.treeWidget)
             item.setText(0, conf_ip)
             self.append_chassis(item, conf_ip)
     item = QTreeWidgetItem(self.treeWidget)
     item.setText(0, get_message("new_input"))
Exemplo n.º 3
0
 def rack_select_changed(self):
     if len(self.listWidget.selectedItems()) == 0:
         return
     selected_item = self.listWidget.selectedItems()[0]
     cimc_ip = selected_item.text()
     if cimc_ip == get_message("new_input"):
         self.set_conn_info_input("", "", "")
     else:
         (conf_id, conf_pw, conf_type) = get_conf_info(str(cimc_ip))
         self.set_conn_info_input(str(cimc_ip), conf_id, conf_pw)
Exemplo n.º 4
0
    def add(self):  # 추가/수정 버튼을 누르면 수행할 동작을 정의한 함수
        (cimc_ip, c_user, c_password) = self.get_conn_info_input()
        if cimc_ip == "" or c_user == "" or c_password == "":
            return False
        c_type = "rack"
        if not self.selected_rack_tab():
            c_type = "blade"
        (exist_ip, exist_conf) = is_exist_conf(cimc_ip, c_user, c_password)

        # 타입이 다른 매니저로 등록된 경우
        if exist_ip:
            (conf_id, conf_pw, conf_type) = get_conf_info(cimc_ip)
            if conf_type != c_type:
                pop_msg(get_message_args("dup_ip", cimc_ip))
                return False

        # 수정
        if exist_conf:
            return False  # 변경사항이 없는 경우 특별한 동작 없이 중단
        # 접속 테스트
        if not connect(cimc_ip, self.get_port_num(), c_user, c_password):
            pop_msg(get_message("conn_fail"))
            if not exist_ip:
                return False  #추가에서 접속에 실패했을 때
            (conf_id, conf_pw, conf_type) = get_conf_info(cimc_ip)
            self.userEdit.setText(conf_id)
            self.passwordEdit.setText(conf_id)
            connect_status[cimc_ip] = False
            self.refresh_current_tab()
            return False
        # 추가
        if not exist_ip:
            if c_type == "blade":
                (system_type, cmd_result) = check_type()
                if system_type != "UCSM_FI":
                    pop_msg(get_message("no_ucs_man"))
                    return False
            set_cfg(cimc_ip, c_user, c_password, c_type)
        connect_status[cimc_ip] = True
        self.refresh_current_tab()
        return True
Exemplo n.º 5
0
 def refresh_rack_list(self):
     self.listWidget.clear()
     for conf_ip in get_ip_list():
         (conf_id, conf_pw, conf_type) = get_conf_info(conf_ip)
         if conf_type != "rack":
             continue
         item = QListWidgetItem(conf_ip)
         if connect_status.get(conf_ip) != None and connect_status[conf_ip]:
             item.setIcon(green_icon)
         else:
             item.setIcon(grey_icon)
         self.listWidget.addItem(item)
     item = QListWidgetItem(get_message("new_input"))
     item.setIcon(blank_icon)
     self.listWidget.addItem(item)
Exemplo n.º 6
0
 def refresh_rack_list(self):
     self.listWidget.clear()  # List Widget의 항목을 모두 삭제
     for conf_ip in get_ip_list():
         (conf_id, conf_pw, conf_type) = get_conf_info(conf_ip)
         if conf_type != "rack":
             continue
         item = QListWidgetItem(conf_ip)  # 리스트의 항목 생성
         if connect_status.get(conf_ip) != None and connect_status[conf_ip]:
             item.setIcon(green_icon)  # 생성한 리스트 항목에 아이콘 적용(녹색)
         else:
             item.setIcon(grey_icon)  # 생성한 리스트 항목에 아이콘 적용(회색)
         self.listWidget.addItem(item)  # 리스트에 생성한 항목 추가
     item = QListWidgetItem(get_message("new_input"))
     item.setIcon(blank_icon)
     self.listWidget.addItem(item)
Exemplo n.º 7
0
 def vkvm_connect_rack(self):  # 랙 서버 매니저 접속 테스트 및 vKVM 접속을 수행하는 함수
     (cimc_ip, c_user, c_password) = self.get_conn_info_input()
     if cimc_ip == "":
         return
     if connect_status.get(
             cimc_ip) == None or connect_status[cimc_ip] == False:
         if not check_active(cimc_ip):
             pop_msg(get_message("conn_fail"))
             connect_status[cimc_ip] = False
             self.refresh_current_tab()
             return
     connect_status[cimc_ip] = True
     self.refresh_current_tab()
     t = vKVM_launcher_Thread()
     t.cimc_ip = cimc_ip
     t.c_user = c_user
     t.c_password = c_password
     t.start()
Exemplo n.º 8
0
 def set_resource(self):
     self.setWindowTitle(get_message("title"))
     self.tabWidget.setTabText(0, get_message("rack_tab_title"))
     self.tabWidget.setTabText(1, get_message("blade_tab_title"))
     self.connInfoBox.setTitle(get_message("conn_info"))
     self.ipLabel.setText(get_message("ip"))
     self.idLabel.setText(get_message("id"))
     self.pwLabel.setText(get_message("pw"))
     self.portLabel.setText(get_message("port"))
     self.addButton.setText(get_message("add"))
     self.removeButton.setText(get_message("delete"))
     self.connButton.setText(get_message("vkvm_conn"))
     self.bladeBox.setTitle(get_message("selected_blade"))
     self.statusBox.setTitle(get_message("status"))
     self.statusList.item(0).setText(get_message("status"))
     self.statusList.item(1).setText(get_message("status_ready"))
     self.statusList.item(2).setText(get_message("status_attached"))
     self.statusList.item(3).setText(get_message("status_etc"))
     self.statusList.item(3).setText(get_message("status_empty"))