Skip to content

Commit

Permalink
Remove hinv and pexpect (#901)
Browse files Browse the repository at this point in the history
  • Loading branch information
larsbijl committed Feb 3, 2021
1 parent 04fcea3 commit 6999b90
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 31 deletions.
1 change: 0 additions & 1 deletion cuegui/cuegui/HostMonitorTree.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
14 changes: 0 additions & 14 deletions cuegui/cuegui/MenuActions.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import subprocess
import time

import pexpect
from PySide2 import QtGui
from PySide2 import QtWidgets
import six
Expand Down Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion cuegui/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
'future',
'grpcio',
'grpcio-tools',
'pexpect',
'PySide2',
'PyYAML',
]
Expand Down
14 changes: 0 additions & 14 deletions cuegui/tests/MenuActions_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 6999b90

Please sign in to comment.
  翻译: