Loading srcc/utils/workgroup.py +4 −4 Original line number Diff line number Diff line Loading @@ -308,7 +308,7 @@ class SUWorkgroupManager(object): """Clear cached workgroups.""" self.workgroups = {} def _request_workgroup(self, workgroup_name, depth=0): def _request_workgroup(self, workgroup_name, depth=0, fetch_owners=True): """load""" if workgroup_name in self.workgroups: # cache hit Loading Loading @@ -347,7 +347,7 @@ class SUWorkgroupManager(object): workgroup.members.add(member.attrib['id']) elif member.tag == "application": workgroup.applications.add(member.attrib['id']) elif child.tag == "administrators": elif child.tag == "administrators" and fetch_owners: for member in child: if member.tag == "workgroup": child_name = member.attrib['id'] Loading Loading @@ -431,11 +431,11 @@ class SUWorkgroupManager(object): if code >= 300 or errmsg: raise SUWorkgroupAPIError(code, errmsg) def workgroup(self, name): def workgroup(self, name, fetch_owners=True): """Get workgroup object from given workgroup name.""" assert name if name not in self.workgroups: return self._request_workgroup(name) return self._request_workgroup(name, fetch_owners=fetch_owners) return self.workgroups[name] def create_workgroup(self, name, description, filter=FILTER_NONE, Loading wgcli.py +4 −0 Original line number Diff line number Diff line Loading @@ -108,6 +108,8 @@ Welcome to Stanford Workgroup CLI tool Commands are: workgroup <workgroup> to select a working workgroup workgroup_full <workgroup> to select a working workgroup and load it with stem-owners (slower) ls to list members tree Loading @@ -132,6 +134,8 @@ Commands are: cmd = args[0] try: if cmd == "workgroup": workgroup = manager.workgroup(args[1], fetch_owners=False) if cmd == "workgroup_full": workgroup = manager.workgroup(args[1]) elif cmd == "add": workgroup.add_member(args[1]) Loading Loading
srcc/utils/workgroup.py +4 −4 Original line number Diff line number Diff line Loading @@ -308,7 +308,7 @@ class SUWorkgroupManager(object): """Clear cached workgroups.""" self.workgroups = {} def _request_workgroup(self, workgroup_name, depth=0): def _request_workgroup(self, workgroup_name, depth=0, fetch_owners=True): """load""" if workgroup_name in self.workgroups: # cache hit Loading Loading @@ -347,7 +347,7 @@ class SUWorkgroupManager(object): workgroup.members.add(member.attrib['id']) elif member.tag == "application": workgroup.applications.add(member.attrib['id']) elif child.tag == "administrators": elif child.tag == "administrators" and fetch_owners: for member in child: if member.tag == "workgroup": child_name = member.attrib['id'] Loading Loading @@ -431,11 +431,11 @@ class SUWorkgroupManager(object): if code >= 300 or errmsg: raise SUWorkgroupAPIError(code, errmsg) def workgroup(self, name): def workgroup(self, name, fetch_owners=True): """Get workgroup object from given workgroup name.""" assert name if name not in self.workgroups: return self._request_workgroup(name) return self._request_workgroup(name, fetch_owners=fetch_owners) return self.workgroups[name] def create_workgroup(self, name, description, filter=FILTER_NONE, Loading
wgcli.py +4 −0 Original line number Diff line number Diff line Loading @@ -108,6 +108,8 @@ Welcome to Stanford Workgroup CLI tool Commands are: workgroup <workgroup> to select a working workgroup workgroup_full <workgroup> to select a working workgroup and load it with stem-owners (slower) ls to list members tree Loading @@ -132,6 +134,8 @@ Commands are: cmd = args[0] try: if cmd == "workgroup": workgroup = manager.workgroup(args[1], fetch_owners=False) if cmd == "workgroup_full": workgroup = manager.workgroup(args[1]) elif cmd == "add": workgroup.add_member(args[1]) Loading