Uploaded image for project: 'Modules'
  1. Modules
  2. MODULES-8685

sqlserver : Syntax Error in login_exists erb template

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: sqlserver, windows
    • Labels:
    • Template:
      MODULES Bug Template
    • Acceptance Criteria:
      Hide

      The user should be able to use the `ensure => absent` functionality of the sqlserver::login resource to delete users, and this functionality should be idempotent.

      An acceptance test should be created to ensure this behavior is not regressed.

      Show
      The user should be able to use the `ensure => absent` functionality of the sqlserver::login resource to delete users, and this functionality should be idempotent. An acceptance test should be created to ensure this behavior is not regressed.
    • Team:
      Windows
    • Story Points:
      1
    • Sprint:
      Windows 2019-03-06
    • Method Found:
      Customer Feedback
    • QA Risk Assessment:
      Needs Assessment

      Description

      Basic Info
      Module Version: 2.3.0
      Puppet Version: N/A
      OS Name/Version: N/A

      The template that is used to check of a login exists (templates\query\login_exists.sql.erb) has a redundant END statement due to it mistakenly being put outside of an if statment. The impact is that even if a login does not exist when using ensure => absent, the resource will run anyway and cause an error in the report.

      The error is not a syntax error for the erb template language, but results in a dynamic sql statement that throws a syntax error when run against the server. Since the return code is non-zero the `onlyif` clause of the tsql resource causes the delete statement to run even if the login is not present, breaking idempotency for the sqlserver::login resource.

       

        Attachments

          Activity

            People

            Assignee:
            william.hurt William Hurt
            Reporter:
            dylan.ratcliffe Dylan Ratcliffe
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support