64 lines
1.1 KiB
Python
Executable File
64 lines
1.1 KiB
Python
Executable File
#!/usr/bin/env python
|
|
# encoding: utf-8
|
|
#
|
|
# $Id$
|
|
# $URL$
|
|
|
|
"""
|
|
userconfig.py
|
|
|
|
Created by Marcus Stoegbauer on 2013-01-10.
|
|
Copyright (c) 2013 __MyCompanyName__. All rights reserved.
|
|
"""
|
|
|
|
import sys
|
|
import os
|
|
from checks import checks
|
|
|
|
classchecks = checks()
|
|
|
|
configdir = "../"
|
|
|
|
hostclasses = classchecks.__classesForHost__()
|
|
|
|
def work(directory):
|
|
"""docstring for work"""
|
|
if not os.path.isfile(directory+"/DEST"):
|
|
return
|
|
# if not DEST
|
|
dirs = os.listdir(directory)
|
|
dirs.remove("DEST")
|
|
for h in hostclasses:
|
|
if h[0] != "":
|
|
classdir = directory+"/"+h[0]+"_"+h[1]
|
|
else:
|
|
classdir = directory+"/"+h[1]
|
|
# if all
|
|
if os.path.isdir(classdir):
|
|
print "Directory",classdir,"exists."
|
|
# if classdir
|
|
# for hostclasses
|
|
return
|
|
# def work
|
|
|
|
def main():
|
|
print "Classes for host:",hostclasses
|
|
for d in os.listdir(configdir):
|
|
name = configdir+d
|
|
if not os.path.isdir(name):
|
|
continue
|
|
elif d.startswith(".svn"):
|
|
continue
|
|
elif os.path.isfile(name+"/.ignore"):
|
|
continue
|
|
else:
|
|
work(name)
|
|
# if
|
|
# for d
|
|
# def main
|
|
|
|
|
|
if __name__ == '__main__':
|
|
main()
|
|
|