Uploaded image for project: 'CFEngine Community'
  1. CFEngine Community
  2. CFE-3560

unless attribute produces info level log about an apparent problem

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: 3.17.0
    • Fix Version/s: 3.12.7, 3.15.4, 3.18.0
    • Component/s: None
    • Labels:
    • Story Points:
      0

      Description

      Passing a string that contains spaces into the unless attribute results in an info log message about class expressions not being able to contain spaces without an operator.

      bundle agent main
      {
          vars:
            "my_var" string => "my value"; # Danger will robinson....
      
          classes:
            # Define a class using a string variable value
            "my_class_from_string_$(my_var)"
              expression => "any"; 
      
          reports:
            "Why don't I have a class for '$(my_var)'?" # Note: this isn't emitted
              unless => "my_class_from_string_$(my_var)";
      
            "When CFEngine defines a class, it will automatically canonify it for you, but it won't do that when /checking/ if a class exists."
               if => canonify( "my_class_from_string_$(my_var)" );
      }
      
          info: class names can't be separated by whitespace without an intervening operator in expression 'my_class_from_string_my value'
          info: class names can't be separated by whitespace without an intervening operator in expression 'my_class_from_string_my value'
      R: When CFEngine defines a class, it will automatically canonify it for you, but it won't do that when /checking/ if a class exists.
          info: class names can't be separated by whitespace without an intervening operator in expression 'my_class_from_string_my value'
          info: class names can't be separated by whitespace without an intervening operator in expression 'my_class_from_string_my value'
      R: Why don't I have a class for 'my value'?

      According to CONTRIBUTING.md:

      • LOG_LEVEL_INFO: Useful high-level information about what the process is
        doing. Examples:
        • Changes performed to the system, for example when a promise has been repaired.
        • Server denies access to the client based on `access_rules`.

      Since it's not really a change to the system, I think that that log message should go to ERROR or VERBOSE. Also, I think that it should probably say class expression instead of class name if it's evaluating it as an expression.

        Attachments

          Activity

            People

            • Assignee:
              Alias Georgios Kotzampopoulos
              Reporter:
              a10042 Nick Anderson
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Summary Panel