コード例 #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
ファイル: iscsi_cli_utils.py プロジェクト: MODITDC/os-win
 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
ファイル: fc_utils.py プロジェクト: alinbalutoiu/os-win
 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]
コード例 #6
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
ファイル: test_pathutils.py プロジェクト: openstack/os-win
 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)