Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-13441

Inconsistent error handling in user management shell helpers

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.6.1, 2.7.0
    • Affects Version/s: 2.6.0-rc2
    • Component/s: Security, Shell
    • None
    • Minor Change

      Issue Status as of April 15, 2014

      ISSUE SUMMARY
      User management shell helpers like dropUser(), getUser() and getRole() show inconsistent behavior when a user is not found. Specifically, getUser() and getRole() throw an exception, but dropUser() returns false.

      USER IMPACT
      Minor impact, but user interface changes slightly, which may affect users who automate or script MongoDB user management.

      WORKAROUNDS
      None.

      RESOLUTION
      Change the behavior so that getUser() and getRole() do not throw but instead return null if the user does not exist.

      AFFECTED VERSIONS
      Version 2.6.0 is affected by this bug.

      PATCHES
      The patch is included in the 2.6.1 production release.

      Original description

      Other user management helpers such as dropUser do not throw if the user is not found - dropUser just returns false. We should change getUser and getRole to simply return null if the user/role isn't found

            Assignee:
            spencer@mongodb.com Spencer Brody (Inactive)
            Reporter:
            spencer@mongodb.com Spencer Brody (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: