Beispiel #1
0
def qdevice_destroy(lib_env, model):
    """
    Stop and disable qdevice on local host and remove its configuration
    string model qdevice model to destroy
    """
    _ensure_not_cman(lib_env)
    _check_model(model)
    _service_stop(lib_env, qdevice_net.qdevice_stop)
    _service_disable(lib_env, qdevice_net.qdevice_disable)
    qdevice_net.qdevice_destroy()
    lib_env.report_processor.process(reports.qdevice_destroy_success(model))
Beispiel #2
0
def qdevice_destroy(lib_env, model, proceed_if_used=False):
    """
    Stop and disable qdevice on local host and remove its configuration
    string model qdevice model to destroy
    bool procced_if_used destroy qdevice even if it is used by clusters
    """
    _check_model(model)
    _check_qdevice_not_used(lib_env.report_processor, lib_env.cmd_runner(),
                            model, proceed_if_used)
    _service_stop(lib_env, qdevice_net.qdevice_stop)
    _service_disable(lib_env, qdevice_net.qdevice_disable)
    qdevice_net.qdevice_destroy()
    lib_env.report_processor.process(reports.qdevice_destroy_success(model))
Beispiel #3
0
def qdevice_destroy(lib_env: LibraryEnvironment, model, proceed_if_used=False):
    """
    Stop and disable qdevice on local host and remove its configuration
    string model qdevice model to destroy
    bool procced_if_used destroy qdevice even if it is used by clusters
    """
    _check_model(model)
    _check_qdevice_not_used(lib_env.report_processor, lib_env.cmd_runner(),
                            model, proceed_if_used)
    _service_stop(lib_env, qdevice_net.qdevice_stop)
    _service_disable(lib_env, qdevice_net.qdevice_disable)
    qdevice_net.qdevice_destroy()
    lib_env.report_processor.report(
        ReportItem.info(reports.messages.QdeviceDestroySuccess(model)))
Beispiel #4
0
def qdevice_destroy(lib_env, model, proceed_if_used=False):
    """
    Stop and disable qdevice on local host and remove its configuration
    string model qdevice model to destroy
    bool procced_if_used destroy qdevice even if it is used by clusters
    """
    _check_model(model)
    _check_qdevice_not_used(
        lib_env.report_processor,
        lib_env.cmd_runner(),
        model,
        proceed_if_used
    )
    _service_stop(lib_env, qdevice_net.qdevice_stop)
    _service_disable(lib_env, qdevice_net.qdevice_disable)
    qdevice_net.qdevice_destroy()
    lib_env.report_processor.process(reports.qdevice_destroy_success(model))
Beispiel #5
0
 def test_not_initialized(self, mock_initialized, mock_rmtree):
     mock_initialized.return_value = False
     lib.qdevice_destroy()
     mock_rmtree.assert_not_called()
Beispiel #6
0
 def test_success(self, mock_initialized, mock_rmtree):
     mock_initialized.return_value = True
     lib.qdevice_destroy()
     mock_rmtree.assert_called_once_with(_qnetd_cert_dir)
Beispiel #7
0
 def test_success(self, mock_initialized, mock_rmtree):
     mock_initialized.return_value = True
     lib.qdevice_destroy()
     mock_rmtree.assert_called_once_with(
         settings.corosync_qdevice_net_server_certs_dir
     )
Beispiel #8
0
 def test_not_initialized(self, mock_initialized, mock_rmtree):
     mock_initialized.return_value = False
     lib.qdevice_destroy()
     mock_rmtree.assert_not_called()
Beispiel #9
0
 def test_success(self, mock_initialized, mock_rmtree):
     mock_initialized.return_value = True
     lib.qdevice_destroy()
     mock_rmtree.assert_called_once_with(_qnetd_cert_dir)
 def test_success(self, mock_rmtree):
     lib.qdevice_destroy()
     mock_rmtree.assert_called_once_with(_qnetd_cert_dir)