Revision d748d9a7

b/lib/cmdlib.py
2016 2016
        # All or no nodes
2017 2017
        errorif(missing_file and missing_file != node_names,
2018 2018
                cls.ECLUSTERFILECHECK, None,
2019
                "File %s is optional, but it must exist on all or no nodes (not"
2020
                " found on %s)",
2019
                "File %s is optional, but it must exist on all or no"
2020
                " nodes (not found on %s)",
2021 2021
                filename, utils.CommaJoin(utils.NiceSort(missing_file)))
2022 2022
      else:
2023 2023
        errorif(missing_file, cls.ECLUSTERFILECHECK, None,
......
2419 2419
    """Build hooks nodes.
2420 2420

  
2421 2421
    """
2422
    assert self.my_node_names, ("Node list not gathered,"
2423
      " has CheckPrereq been executed?")
2424 2422
    return ([], self.my_node_names)
2425 2423

  
2426 2424
  def Exec(self, feedback_fn):
......
2428 2426

  
2429 2427
    """
2430 2428
    # This method has too many local variables. pylint: disable-msg=R0914
2429

  
2430
    if not self.my_node_names:
2431
      # empty node group
2432
      feedback_fn("* Empty node group, skipping verification")
2433
      return True
2434

  
2431 2435
    self.bad = False
2432 2436
    _ErrorIf = self._ErrorIf # pylint: disable-msg=C0103
2433 2437
    verbose = self.op.verbose
......
2808 2812
        and hook results
2809 2813

  
2810 2814
    """
2811
    # We only really run POST phase hooks, and are only interested in
2812
    # their results
2813
    if phase == constants.HOOKS_PHASE_POST:
2815
    # We only really run POST phase hooks, only for non-empty groups,
2816
    # and are only interested in their results
2817
    if not self.my_node_names:
2818
      # empty node group
2819
      pass
2820
    elif phase == constants.HOOKS_PHASE_POST:
2814 2821
      # Used to change hooks' output to proper indentation
2815 2822
      feedback_fn("* Hooks Results")
2816 2823
      assert hooks_results, "invalid result from hooks"
......
2836 2843
            feedback_fn("%s" % output)
2837 2844
            lu_result = 0
2838 2845

  
2839
      return lu_result
2846
    return lu_result
2840 2847

  
2841 2848

  
2842 2849
class LUClusterVerifyDisks(NoHooksLU):

Also available in: Unified diff