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
Example #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
Example #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)
Example #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)
Example #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)
Example #7
0
 def _get_raw_icacls_info(self, path):
     return _utils.execute("icacls.exe", path)[0]
Example #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)