def constraint(constraint_type, constraint_info, with_id=True): """ dict constraint_info see constraint in pcs/lib/exchange_formats.md bool with_id have to show id with options_dict """ if "resource_sets" in constraint_info: return constraint_with_sets(constraint_info, with_id) return constraint_plain(constraint_type, constraint_info, with_id)
def show_constraints_with_set(constraint_list, show_detail, indent_step=2): """ return list of console lines with info about constraints list of dict constraint_list see constraint in pcs/lib/exchange_formats.md bool with_id have to show id with options int indent_step is count of spaces for indenting """ return ["Resource Sets:"] + indent([ console_report.constraint_with_sets(constraint, with_id=show_detail) for constraint in constraint_list ], indent_step=indent_step)
def show_constraints_with_set(constraint_list, show_detail, indent_step=2): """ return list of console lines with info about constraints list of dict constraint_list see constraint in pcs/lib/exchange_formats.md bool with_id have to show id with options int indent_step is count of spaces for indenting """ return ["Resource Sets:"] + indent( [ console_report.constraint_with_sets(constraint, with_id=show_detail) for constraint in constraint_list ], indent_step=indent_step )