ovirtclient.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:ovirt-desktop-client 作者: nkovacne 项目源码 文件源码
def acquire_vm_from_vmpool(self, rowid):
        """
            Description: A machine will be acquired by a user if they click on the icon of a VmPool
            Arguments: The row id that has been clicked. This relationship is stored using the VmData class.
            Returns: Nothing
        """

        self.lastclick = int(time())         # Last click timestamp update

        vmtype = self.vmdata[rowid].vmtype

        if vmtype == 'vmpool':
            try:
                QMessageBox.information(None, _('apptitle') + ': ' + _('info'), _('acquiring_vm_from_pool'))
                vmp = conf.OVIRTCONN.vmpools.get(id=self.vmdata[rowid].vmid)
                vmp.allocatevm()
                self.refresh_grid()
            except ConnectionError:
                QMessageBox.critical(None, _('apptitle') + ': ' + _('error'), _('unexpected_connection_drop'))
                quit()
            except RequestError:
                QMessageBox.critical(None, _('apptitle') + ': ' + _('error'), _('cannot_attach_vm_to_user'))
        else:
            QMessageBox.warning(None, _('apptitle') + ': ' + _('warning'), _('object_is_not_a_vmpool'))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号