lgroup.delete() except self._group.DoesNotExist: # it doesn't matter if it doesn't exist pass def set_group_name(self, group, old_name, new_name): """ Group was renamed. """ lgroup = self._groups().get(cn=old_name) lgroup.rename(cn=new_name) def get_group_details(self, group): """ Get the group details. """ result = {} try: lgroup = self._groups().get(cn=group.name) except self._group.DoesNotExist: return result for i, j in lgroup.get_fields(): if j is not None: result[i] = j result['dn'] = lgroup.dn result['primary_accounts'] = [ a.dn for a in lgroup.primary_accounts.all()] result['secondary_accounts'] = [ a.dn for a in lgroup.secondary_accounts.all()] return result trace.attach(trace.trace(logger), GlobalDataStore) trace.attach(trace.trace(logger), MachineCategoryDataStore)
""" Group was deleted. """ try: lgroup = self._get_group(group.name) delete(lgroup, database=self._database) except ObjectDoesNotExist: # it doesn't matter if it doesn't exist pass def set_group_name(self, group, old_name, new_name): """ Group was renamed. """ lgroup = self._get_group(old_name) rename(lgroup, database=self._database, cn=new_name) def get_group_details(self, group): """ Get the group details. """ result = {} try: lgroup = self._get_group(group.name) lgroup = preload(lgroup, database=self._database) except ObjectDoesNotExist: return result for i, j in lgroup.items(): if j is not None: result[i] = j return result trace.attach(trace.trace(logger), DataStore)
self._call(["gmkaccount", "-a", pid, "-u", "MEMBERS"]) def _set_project(self, pid, description, institute): self._call([ "gchaccount", "-d", self._filter_string(description), "-a", pid]) self._call([ "gchaccount", "-X", "Organization=%s" % self._filter_string(institute.name), "-a", pid]) def _delete_project(self, pid): self._call(["grmaccount", "-a", pid]) def MamDataStore(config): ds = MamDataStore71(config) if ds.check_version(): return ds ds = MamDataStore72(config) if ds.check_version(): return ds raise RuntimeError("We do not support this version of MAM") trace.attach(trace.trace(logger), MamDataStoreBase) trace.attach(trace.trace(logger), MamDataStore71) trace.attach(trace.trace(logger), MamDataStore72)
self._call(["delete", "account", "name=%s" % pid]) return def delete_project(self, project): """ Called when project is deleted. """ pid = project.pid # project deleted ds_project = self.get_project(pid) if ds_project is not None: self._call(["delete", "account", "name=%s" % pid]) return def get_project_details(self, project): """ Get the project details. """ result = self.get_project(project.pid) if result is None: result = {} return result def set_project_pid(self, project, old_pid, new_pid): """ Project's pid was changed. """ # FIXME return trace.attach(trace.trace(logger), SlurmDataStore)
def _create_project(self, pid): self._call(["gmkaccount", "-a", pid, "-u", "MEMBERS"]) def _set_project(self, pid, description, institute): self._call( ["gchaccount", "-d", self._filter_string(description), "-a", pid]) self._call([ "gchaccount", "-X", "Organization=%s" % self._filter_string(institute.name), "-a", pid ]) def _delete_project(self, pid): self._call(["grmaccount", "-a", pid]) def MamDataStore(config): ds = MamDataStore71(config) if ds.check_version(): return ds ds = MamDataStore72(config) if ds.check_version(): return ds raise RuntimeError("We do not support this version of MAM") trace.attach(trace.trace(logger), MamDataStoreBase) trace.attach(trace.trace(logger), MamDataStore71) trace.attach(trace.trace(logger), MamDataStore72)
# it doesn't matter if it doesn't exist pass def set_group_name(self, group, old_name, new_name): """ Group was renamed. """ lgroup = self._groups().get(cn=old_name) lgroup.rename(cn=new_name) def get_group_details(self, group): """ Get the group details. """ result = {} try: lgroup = self._groups().get(cn=group.name) except self._group.DoesNotExist: return result for i, j in lgroup.get_fields(): if j is not None: result[i] = j result['dn'] = lgroup.dn result['primary_accounts'] = [ a.dn for a in lgroup.primary_accounts.all() ] result['secondary_accounts'] = [ a.dn for a in lgroup.secondary_accounts.all() ] return result trace.attach(trace.trace(logger), GlobalDataStore) trace.attach(trace.trace(logger), MachineCategoryDataStore)