diff --git a/lib/client/gnt_cluster.py b/lib/client/gnt_cluster.py index ad7d95cd49c406a754dba6e9657b9237491af762..2ac33dfafbf9f981cc805f114b081097472eef6b 100644 --- a/lib/client/gnt_cluster.py +++ b/lib/client/gnt_cluster.py @@ -1002,12 +1002,13 @@ def _OobPower(opts, node_list, power): return True -def _InstanceStart(opts, inst_list, start): +def _InstanceStart(opts, inst_list, start, no_remember=False): """Puts the instances in the list to desired state. @param opts: The command line options selected by the user @param inst_list: The list of instances to operate on @param start: True if they should be started, False for shutdown + @param no_remember: If the instance state should be remembered @return: The success of the operation (none failed) """ @@ -1016,7 +1017,8 @@ def _InstanceStart(opts, inst_list, start): text_submit, text_success, text_failed = ("startup", "started", "starting") else: opcls = compat.partial(opcodes.OpInstanceShutdown, - timeout=opts.shutdown_timeout) + timeout=opts.shutdown_timeout, + no_remember=no_remember) text_submit, text_success, text_failed = ("shutdown", "stopped", "stopping") jex = JobExecutor(opts=opts) @@ -1196,7 +1198,7 @@ def _EpoOff(opts, node_list, inst_map): @return: The desired exit status """ - if not _InstanceStart(opts, inst_map.keys(), False): + if not _InstanceStart(opts, inst_map.keys(), False, no_remember=True): ToStderr("Please investigate and stop instances manually before continuing") return constants.EXIT_FAILURE diff --git a/qa/qa_cluster.py b/qa/qa_cluster.py index a9381a9b88639a5f2202f7d0295c1fe42ce91284..3d5847abc0d4ab04ecfaeab207f837fb32c4be4a 100644 --- a/qa/qa_cluster.py +++ b/qa/qa_cluster.py @@ -202,7 +202,8 @@ def TestClusterEpo(): # All instances should have been stopped now result_output = GetCommandOutput(master["primary"], "gnt-instance list --no-headers -o status") - AssertEqual(compat.all(status == "ADMIN_down" + # ERROR_down because the instance is stopped but not recorded as such + AssertEqual(compat.all(status == "ERROR_down" for status in result_output.splitlines()), True) # Now start everything again