X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=nm.py;h=36d121bc581f0208b88e6522fc2550c2b64ca782;hb=4f04767359981da2906f6c4a0315e5da147db3bf;hp=bb0a2ab35a8acb8b90142c10e87c5a6a9852f475;hpb=1170627c76832513faf152af5bf1d4ffaf588c02;p=nodemanager.git diff --git a/nm.py b/nm.py index bb0a2ab..36d121b 100755 --- a/nm.py +++ b/nm.py @@ -39,9 +39,15 @@ parser.add_option('-k', '--session', action='store', dest='session', default='/e parser.add_option('-p', '--period', action='store', dest='period', default=600, help='Polling interval (sec)') parser.add_option('-r', '--random', action='store', dest='random', default=301, help='Range for additional random polling interval (sec)') parser.add_option('-v', '--verbose', action='store_true', dest='verbose', default=False, help='more verbose log') +parser.add_option('-P', '--path', action='store', dest='path', default='/usr/share/NodeManager/plugins', help='Path to plugins directory') parser.add_option('-m', '--module', action='store', dest='module', default='', help='run a single module among '+' '.join(known_modules)) (options, args) = parser.parse_args() +# Deal with plugins directory +if os.path.exists(options.path): + sys.path.append(options.path) + known_modules += [i[:-3] for i in os.listdir(options.path) if i.endswith(".py") and (i[:-3] not in known_modules)] + modules = [] def GetSlivers(plc):