From ae872e5d70f67c52ebd19c9b918a1a07ceef51f8 Mon Sep 17 00:00:00 2001 From: Valentin Samir Date: Mon, 26 Aug 2013 13:34:57 +0200 Subject: [PATCH] [ressuscite_lc] wrapper tout con vers la fonction de resurrection de lc_ldap --- gestion/ressuscite_lc.py | 18 ++++++++++++++++++ respbats/ressuscite_lc | 3 +++ 2 files changed, 21 insertions(+) create mode 100755 gestion/ressuscite_lc.py create mode 100755 respbats/ressuscite_lc diff --git a/gestion/ressuscite_lc.py b/gestion/ressuscite_lc.py new file mode 100755 index 00000000..10b1ecdd --- /dev/null +++ b/gestion/ressuscite_lc.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python +# -*- mode: python; coding: utf-8 -*- + +import sys +sys.path.append('/usr/scripts/') +import lc_ldap.shortcuts + +if __name__ == '__main__': + if len(sys.argv) >=2: + conn=lc_ldap.shortcuts.lc_ldap_admin() + for file in sys.argv[1:]: + try: + conn.ressuscite(file) + except lc_ldap.attributs.UniquenessError as e: + sys.stderr.write("%s\n" % e) + + else: + sys.stderr.write("Usage: %s [fichier_du_cimetière]*\nLe cimetière est dans /home/cimetiere_lc/\n" % sys.argv[0]) diff --git a/respbats/ressuscite_lc b/respbats/ressuscite_lc new file mode 100755 index 00000000..a4727123 --- /dev/null +++ b/respbats/ressuscite_lc @@ -0,0 +1,3 @@ +#! /bin/sh + +LANG=fr_FR.UTF-8 sudo -u respbats /usr/scripts/gestion/ressuscite_lc.py $*