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
 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)