From 6999b9062650eb06e062e4aa3ca09330f83fc2b1 Mon Sep 17 00:00:00 2001 From: Lars van der Bijl <285658+larsbijl@users.noreply.github.com> Date: Wed, 3 Feb 2021 17:51:26 +0000 Subject: [PATCH] Remove hinv and pexpect (#901) --- cuegui/cuegui/HostMonitorTree.py | 1 - cuegui/cuegui/MenuActions.py | 14 -------------- cuegui/setup.py | 1 - cuegui/tests/MenuActions_tests.py | 14 -------------- requirements.txt | 1 - 5 files changed, 31 deletions(-) diff --git a/cuegui/cuegui/HostMonitorTree.py b/cuegui/cuegui/HostMonitorTree.py index 6e0da13b0..6b88f8241 100644 --- a/cuegui/cuegui/HostMonitorTree.py +++ b/cuegui/cuegui/HostMonitorTree.py @@ -250,7 +250,6 @@ def contextMenuEvent(self, e): menu = QtWidgets.QMenu() self.__menuActions.hosts().addAction(menu, "viewComments") self.__menuActions.hosts().addAction(menu, "viewProc") - self.__menuActions.hosts().addAction(menu, "hinv") self.__menuActions.hosts().addAction(menu, "lock") self.__menuActions.hosts().addAction(menu, "unlock") self.__menuActions.hosts().addAction(menu, "addTags") diff --git a/cuegui/cuegui/MenuActions.py b/cuegui/cuegui/MenuActions.py index 6a59ebac5..8f6fac07f 100644 --- a/cuegui/cuegui/MenuActions.py +++ b/cuegui/cuegui/MenuActions.py @@ -30,7 +30,6 @@ import subprocess import time -import pexpect from PySide2 import QtGui from PySide2 import QtWidgets import six @@ -1212,19 +1211,6 @@ def viewProc(self, rpcObjects=None): if hosts: QtGui.qApp.view_procs.emit(hosts) - hinv_info = ["View Host Information (hinv)", None, "view"] - def hinv(self, rpcObjects=None): - hosts = self._getOnlyHostObjects(rpcObjects) - for host in hosts: - try: - lines = pexpect.run("rsh %s hinv" % host.data.name, timeout=10).splitlines() - QtWidgets.QMessageBox.information(self._caller, - "%s hinv" % host.data.name, - "\n".join(lines), - QtWidgets.QMessageBox.Ok) - except Exception as e: - logger.warning("Failed to get host's hinv: %s" % e) - lock_info = ["Lock Host", None, "lock"] def lock(self, rpcObjects=None): hosts = self._getOnlyHostObjects(rpcObjects) diff --git a/cuegui/setup.py b/cuegui/setup.py index d918a1bf0..eff519b23 100644 --- a/cuegui/setup.py +++ b/cuegui/setup.py @@ -61,7 +61,6 @@ 'future', 'grpcio', 'grpcio-tools', - 'pexpect', 'PySide2', 'PyYAML', ] diff --git a/cuegui/tests/MenuActions_tests.py b/cuegui/tests/MenuActions_tests.py index 8fd225589..a1490da44 100644 --- a/cuegui/tests/MenuActions_tests.py +++ b/cuegui/tests/MenuActions_tests.py @@ -1166,20 +1166,6 @@ def test_viewProc(self, qAppMock): qAppMock.view_procs.emit.assert_called_with([hostName]) - @mock.patch('PySide2.QtWidgets.QMessageBox') - @mock.patch('pexpect.run') - def test_hinv(self, runMock, qMessageBoxMock): - hostName = 'arbitrary-name' - host = opencue.wrappers.host.Host( - opencue.compiled_proto.host_pb2.Host(id='arbitrary-id', name=hostName)) - rshResponse = 'response line one\nanother response line' - runMock.return_value = rshResponse - - self.host_actions.hinv(rpcObjects=[host]) - - qMessageBoxMock.information.assert_called_with( - mock.ANY, '%s hinv' % hostName, rshResponse, mock.ANY) - def test_lock(self): host = opencue.wrappers.host.Host( opencue.compiled_proto.host_pb2.Host(id='arbitrary-id')) diff --git a/requirements.txt b/requirements.txt index 1778660a3..fc1123fad 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,7 +6,6 @@ grpcio==1.16.0 grpcio-tools==1.16.0 mock==2.0.0 pathlib==1.0.1;python_version<"3.4" -pexpect==4.6.0 psutil==5.6.6 pyfakefs==3.6 pylint==2.6.0;python_version>="3.7"