Uploaded image for project: 'Red Hat Insights Engineering'
  1. Red Hat Insights Engineering
  2. RHINENG-12953

Display name and Ansible hostname should strip whitespace

XMLWordPrintable

    • 1
    • Interact Sprint 63, Interact Sprint 64

      ** Note that this is a public ticket, please refrain from adding any sensitive data. **

      Description of Problem

      It is possible to set both Display name and Ansible hostname to a space character, ' '. Not only this makes the UI confusing, it makes you unable to click the host in the Systems page: you have to click Edit, change the name and only then you can open the host details.

      Trailing whitespace is cleaned on some places, but not consistently; display name "test   " is stored as such.

      How reproducible

      Always

      Steps to Reproduce

      1. Open host details
      2. Edit display name or ansible hostname to be just a space

      Or

      1. Run insights-client --display-name " "

      Actual Behavior

      You can set their values to a single space character.

      Expected Behavior

      Both Display name and Ansible hostname should be stripped from whitespace on both prefix and suffix. If the stripped value is an empty string, the value is rejected.

      Business Impact / Additional info{}{}

      Handling of those two values is also inconsistent. It is possible to run insights-client --ansible-host "", which will result in the value being reset to the value of Hostname. insights-client --display-name "" results in a error 400 'Length must be between 1 and 200.'. There's no preference into which behavior is correct, but they should be consistent.

              rhn-engineering-micjohns Michael Johnson
              mhorky@redhat.com Matyas Horky
              Zhamilya Abikenova Zhamilya Abikenova
              Votes:
              0 Vote for this issue
              Watchers:
              13 Start watching this issue

                Created:
                Updated:
                Resolved: