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

Internal (mis-)translation of argument in services

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: 3.7.1, 3.7.4
    • Fix Version/s: 3.10.0
    • Component/s: Built-in functions
    • Labels:
      None
    • Environment:
      Centos 6/7
    • Platform:
      RHEL or CentOS
    • Steps to reproduce:
      Manual steps provided

      Description

      It seems that the default service_method body translate a "reload" command to "restart" before sending it to the service_bundle. Its seems to do the same with "enable/disable" to "start/stop".
      This seems to only affect the default service_method body as I've tested with a custom one as well as using methods, as shown below:

      Unable to find source-code formatter for language: cfengine. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      # cat test_services.cf
      bundle agent main {
        services:
          "service"
           service_policy => "reload";
      
          "service_test"
           service_policy => "reload",
           service_method => service_test;
      
        methods:
          "" usebundle => standard_services("service_method", "reload");
          "" usebundle => non_standard_services("service_test_method", "reload");
      }
      
      body service_method service_test {
        service_bundle => non_standard_services("$(this.promiser)","$(this.service_policy)");
      }
      
      bundle agent non_standard_services(service,state) {
        reports:
           "Test non_standard_services promise for \"$(service)\" -> $(state)";
      }
      
      bundle agent standard_services(service,state){
        reports:
           "Test standard_service promise for \"$(service)\" -> $(state)";
      }
      # cf-agent -KIf ./test_services.cf
      R: Test standard_service promise for "service_method" -> reload
      R: Test non_standard_services promise for "service_test_method" -> reload
      R: Test standard_service promise for "service" -> restart
      R: Test non_standard_services promise for "service_test" -> reload
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                a10042 Nick Anderson
                Reporter:
                cffr Christoffer Frost
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Summary Panel