def execute(self, *args, **kwargs): stdout_value, stderr_value = _utils.execute(*args, **kwargs) if stdout_value.find('The operation completed successfully') == -1: raise exceptions.HyperVException( _('An error has occurred when calling the iscsi initiator: %s') % stdout_value) return stdout_value
def rescan_disks(self): # TODO(lpetrut): find a better way to do this. cmd = ("cmd", "/c", "echo", "rescan", "|", "diskpart.exe") _utils.execute(*cmd)
def test_execute(self, mock_execute): _utils.execute(mock.sentinel.cmd, kwarg=mock.sentinel.kwarg) mock_execute.assert_called_once_with(mock.sentinel.cmd, kwarg=mock.sentinel.kwarg)
def _get_raw_icacls_info(self, path): return _utils.execute("icacls.exe", path)[0]