[munin/link_plugins.py] on linke plus proprement
darcs-hash:20090421213629-bd074-74bc0807bb30a4cbde5ca46d6368f7f1b3fb19ef.gz
This commit is contained in:
parent
f0c913ab8e
commit
10147a431a
1 changed files with 8 additions and 3 deletions
|
@ -49,7 +49,7 @@ if sys.version_info < (2, 5):
|
||||||
|
|
||||||
def register_quirk(f):
|
def register_quirk(f):
|
||||||
QUIRKS.append(f)
|
QUIRKS.append(f)
|
||||||
|
|
||||||
def get_munin_plugins():
|
def get_munin_plugins():
|
||||||
"""Liste les plugins munin créés par le système
|
"""Liste les plugins munin créés par le système
|
||||||
|
|
||||||
|
@ -126,7 +126,12 @@ def link_plugins(plugins, directory):
|
||||||
"""Lie les plugins dans le répertoire directory"""
|
"""Lie les plugins dans le répertoire directory"""
|
||||||
|
|
||||||
for name, path in plugins.iteritems():
|
for name, path in plugins.iteritems():
|
||||||
os.symlink(path, os.path.join(directory, name))
|
try:
|
||||||
|
os.symlink(path, os.path.join(directory, name))
|
||||||
|
if sys.argv(1) == '-v':
|
||||||
|
print "%s installé avec succès!" % name
|
||||||
|
except OSError:
|
||||||
|
print "Echec à l'installation de %s (déjà installé?)" % name
|
||||||
|
|
||||||
# Hack propre
|
# Hack propre
|
||||||
def add_plugin(plugin):
|
def add_plugin(plugin):
|
||||||
|
@ -209,4 +214,4 @@ if __name__ == "__main__":
|
||||||
shutil.rmtree(options.directory)
|
shutil.rmtree(options.directory)
|
||||||
os.mkdir(options.directory)
|
os.mkdir(options.directory)
|
||||||
link_plugins(plugins, options.directory)
|
link_plugins(plugins, options.directory)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue