예제 #1
0
 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
예제 #2
0
 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
예제 #3
0
 def rescan_disks(self):
     # TODO(lpetrut): find a better way to do this.
     cmd = ("cmd", "/c", "echo", "rescan", "|", "diskpart.exe")
     _utils.execute(*cmd)
예제 #4
0
 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)
예제 #5
0
 def _get_raw_icacls_info(self, path):
     return _utils.execute("icacls.exe", path)[0]
 def rescan_disks(self):
     # TODO(lpetrut): find a better way to do this.
     cmd = ("cmd", "/c", "echo", "rescan", "|", "diskpart.exe")
     _utils.execute(*cmd)
예제 #7
0
 def _get_raw_icacls_info(self, path):
     return _utils.execute("icacls.exe", path)[0]
예제 #8
0
파일: test_utils.py 프로젝트: ezzze/os-win
 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)