Skip to content

Commit 97638af

Browse files
committed
Crowd: method revert and remove lxml, as it's extra modules have to be installed
1 parent 928c899 commit 97638af

File tree

2 files changed

+0
-22
lines changed

2 files changed

+0
-22
lines changed

atlassian/crowd.py

-21
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import logging
33

44
from jmespath import search
5-
from lxml import etree
65

76
from .rest_client import AtlassianRestAPI
87

@@ -265,23 +264,3 @@ def update_plugin_license(self, plugin_key, raw_license):
265264
url = "/plugins/1.0/{plugin_key}/license".format(plugin_key=plugin_key)
266265
data = {"rawLicense": raw_license}
267266
return self.put(url, data=data, headers=app_headers)
268-
269-
@property
270-
def memberships(self):
271-
"""
272-
Retrieves full details of all group memberships, with users and nested groups.
273-
See: https://docs.atlassian.com/atlassian-crowd/5.3.1/REST/#usermanagement/1/group-getAllMemberships
274-
Retrieves full details of all group memberships, with users and nested groups.
275-
This resource is optimised for streaming XML responses, and does not support JSON responses.
276-
:return: All membership mapping dict
277-
"""
278-
path = self._crowd_api_url("usermanagement", "group/membership")
279-
headers = {"Accept": "application/xml"}
280-
response = self.get(path, headers=headers, advanced_mode=True)
281-
root = etree.fromstring(response.content)
282-
memberships = {}
283-
for member in root.xpath("//membership"):
284-
group = member.get("group")
285-
users = [user.get("name") for user in member.xpath("./users/user")]
286-
memberships[group] = users
287-
return memberships

requirements.txt

-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,3 @@ requests-kerberos==0.14.0
77
# Add this package to search string in json
88
jmespath
99
beautifulsoup4
10-
lxml

0 commit comments

Comments
 (0)