[Dev OpenGP] [84] Added daemon

[ Thread Index | Date Index | More opengp.tuxfamily.org/development Archives ]


Revision: 84
Author:   nicolaf
Date:     2009-03-24 16:14:31 +0100 (Tue, 24 Mar 2009)

Log Message:
-----------
Added daemon

Added Paths:
-----------
    trunk/src/bin/ogpdaemon


Added: trunk/src/bin/ogpdaemon
===================================================================
--- trunk/src/bin/ogpdaemon	                        (rev 0)
+++ trunk/src/bin/ogpdaemon	2009-03-24 15:14:31 UTC (rev 84)
@@ -0,0 +1,28 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*
+
+from ogp.core import *
+from ogp.plugins import *
+
+uri = "ldap://localhost:389";
+userDn = "cn=admin,dc=nodomain"
+passwd = "toor"
+dn='ou=test2,ou=test,dc=nodomain'
+
+# Connection
+core = OgpCore(uri, userDn, passwd)
+
+requiredPlugins=core.getRequiredPlugins(dn)
+for pluginName in requiredPlugins:
+	print "Installing conf for plugin '" + pluginName + "'... ",
+	try:
+		pluginClass = Plugin.getPluginFromName(pluginName)
+		pluginInstance = pluginClass(dn)
+		pluginInstance.installConf()
+		print "\033[0;32mOK\033[0m."
+	except KeyError:
+		print "\033[0;31mfailed\033[0m. Plugin '" + pluginName + "' is missing!"
+	except:
+		print "\033[0;31mfailed\033[0m. Something went wrong!"
+	
+


Property changes on: trunk/src/bin/ogpdaemon
___________________________________________________________________
Name: svn:executable
   + *


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/