HomeClusterLabs Projects

Refactor: scheduler: reduce code duplication when displaying resources

Description

Refactor: scheduler: reduce code duplication when displaying resources

Refactor native_output_string() to use GString, for readability and
maintainability. Refactor common_print() to use it, to reduce duplication and
ensure displays are consistent.

This makes a couple small changes in how things are shown:

  • If pe_print_dev is enabled (a debugging flag not actually used by anything), the additional resource fields are shown with the resource flags rather than their own parenthesized list.
  • The new output model is now consistent with the legacy print model in displaying resource flags with commas (not spaces) between them.

Details

Provenance
kgaillotAuthored on Dec 20 2019, 12:34 PM
Parents
rP356b41727491: Refactor: scheduler: combine two "if" statements
Branches
Unknown
Tags
Unknown

Event Timeline