Skip to content
This repository has been archived by the owner on Sep 16, 2020. It is now read-only.

grant role to user: handle admin roles with space #708

Merged
merged 2 commits into from
Jun 26, 2019
Merged

grant role to user: handle admin roles with space #708

merged 2 commits into from
Jun 26, 2019

Conversation

pilou-
Copy link
Contributor

@pilou- pilou- commented Jun 11, 2019

Fix Unable to add user when granted role contains a space:

$ awx-cli send <<EOF
[
  {
    "asset_type": "organization",
    "name": "MyOrg",
    "asset_relation": {
      "roles": [
        {
          "name": "Inventory Admin",
          "user": ["misc"],
          "team": []
        }
      ]
    }
  }
]
EOF

ORGANIZATION [MyOrg] ***
Asset up to date
Unable to add user misc to Inventory Admin role: The requested object could not be found.

pilou- added 2 commits June 11, 2019 02:47
Fix 'Unable to add user' when granted role contains a space:

    $ awx-cli send <<EOF
    [
      {
        "asset_type": "organization",
        "name": "MyOrg",
        "asset_relation": {
          "roles": [
            {
              "name": "Inventory Admin",
              "user": ["misc"],
              "team": []
            }
          ]
        }
      }
    ]
    EOF

    ORGANIZATION [MyOrg] ***
    Asset up to date
    Unable to add user misc to Inventory Admin role: The requested object could not be found.
@coveralls
Copy link

Coverage Status

Coverage remained the same at 64.318% when pulling 059c195 on pilou-:handle_admin_roles_with_space into a2b151f on ansible:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage remained the same at 64.318% when pulling 059c195 on pilou-:handle_admin_roles_with_space into a2b151f on ansible:master.

Copy link
Member

@AlanCoding AlanCoding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, I suspect this code predates those role names, so this is a logical fix

@AlanCoding AlanCoding merged commit fa54024 into ansible:master Jun 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants