+
+ def CreateGroup(self, name, owner, id=None):
+ cdef afs_int32 code, cid
+
+ name = name[:PR_MAXNAMELEN].lower()
+ oid = self.NameToId(owner)
+ if oid == ANONYMOUSID:
+ raise Exception("Error creating group: owner does not exist")
+
+ if id is not None:
+ cid = id
+ code = ubik_PR_INewEntry(self.client, 0, name, cid, oid)
+ else:
+ code = ubik_PR_NewEntry(self.client, 0, name, PRGRP, oid, &cid)
+
+ if code != 0:
+ raise Exception("Failed to create group: %s" % afs_error_message(code))
+ return cid