Example #1
0
def main():
    (opts, args) = getopts()
    if chkopts(opts) is True:
        return PROCERROR

    cf = readconf(opts.config)
    if cf is None:
        print >>sys.stderr, 'Failed to load the config file "%s". (%s)' % (opts.config, sys.argv[0])
        return PROCERROR
    
    # conf parse
    if parse_conf(cf) is False:
        return PROCERROR

    if reload_conf(cf["env.sys.log.conf.path"]):
        logger = logging.getLogger('pysilhouette.scheduler')
    else:
        print >>sys.stderr, 'Failed to load the log file. (%s)' % sys.argv[0]
        return PROCERROR
    
    try:
        try:
            signal.signal(signal.SIGTERM, sigterm_handler)
            scheduler = Scheduler(opts, cf)
            ret = scheduler.process() # start!!
            return ret
        except KeyboardInterrupt, k:
            logger.critical('Keyboard interrupt occurred. - %s' % str(k.args))
            print >>sys.stderr, 'Keyboard interrupt occurred. - %s' % str(k.args)
        except Exception, e:
            logger.critical('A system error has occurred. - %s' % str(e.args))
            print >>sys.stderr, 'A system error has occurred. - %s' % str(e.args)
            print >>sys.stderr, traceback.format_exc()
            t_logger = logging.getLogger('pysilhouette_traceback')
            t_logger.critical(traceback.format_exc())
Example #2
0
    import mako
    import sqlalchemy
    if env.has_key('FCGI') is True:
        import flup
    import simplejson
    import libvirt
    # pysilhouette module
    import pysilhouette
except ImportError, e:
    print >>sys.stderr, '[Error] There are not enough libraries. - %s' % ''.join(e.args)
    traceback.format_exc()
    sys.exit(1)

# pysilhouette config read.
from pysilhouette.prep import readconf
karesansui.sheconf = readconf(karesansui.config['pysilhouette.conf.path'])

if karesansui.sheconf is None:
    print >>sys.stderr, '[Error] Failed to load configuration file. (PySilhouette)'
    sys.exit(1)
    
import pysilhouette.prep
if pysilhouette.prep.parse_conf(karesansui.sheconf) is False:
    sys.exit(1)

# URL structure
import karesansui.urls
urls = karesansui.urls.urls


def main():
Example #3
0
                 'test_case19', 'test_case20', 'test_case21',
                 'test_case22', 'test_case23', 'test_case24', 
                 'test_case25', 'test_case26', 'test_case27', 
                 'test_case28', 'test_case29', 'test_case30', 
                 'test_case31', 'test_case32']

        unittest.TestSuite.__init__(self,map(TestWorker, tests))

def all_suite_worker():
    return unittest.TestSuite([SuiteWorker()])

if __name__ == '__main__':
    job_path = '/root/repository/pysilhouette_svn/job/'

    os.environ['PYSILHOUETTE_CONF'] = '/etc/pysilhouette/silhouette.conf'
    cf = readconf(os.environ['PYSILHOUETTE_CONF'])
    pysilhouette.log.reload_conf(cf["env.sys.log.conf.path"])

    ok_f_cmd = (u'python /root/pysilhouette/pysilhouette/job/sendmail.py' 
                u' --from="root@localhost"' 
                u' --to="root@localhost"'
                u' --subject="Results of Worker(%s)"' 
                u' --hostname="localhost"' 
                u' --port="25"'
                u' --msg="%s"' 
                u' --charset="utf-8"') 

    ng_f_cmd = (u'python /root/pysilhouette/pysilhouette/job/sendmail_dummy.py' 
                u' --from="root@localhost"' 
                u' --to="root@localhost"' 
                u' --subject="Results of Worker(%s)"' 
Example #4
0
    import sqlalchemy
    if env.has_key('FCGI') is True:
        import flup
    import simplejson
    import libvirt
    # pysilhouette module
    import pysilhouette
except ImportError, e:
    print >> sys.stderr, '[Error] There are not enough libraries. - %s' % ''.join(
        e.args)
    traceback.format_exc()
    sys.exit(1)

# pysilhouette config read.
from pysilhouette.prep import readconf
karesansui.sheconf = readconf(karesansui.config['pysilhouette.conf.path'])

if karesansui.sheconf is None:
    print >> sys.stderr, '[Error] Failed to load configuration file. (PySilhouette)'
    sys.exit(1)

import pysilhouette.prep
if pysilhouette.prep.parse_conf(karesansui.sheconf) is False:
    sys.exit(1)

# URL structure
import karesansui.urls
urls = karesansui.urls.urls


def main():
Example #5
0
            'test_case25', 'test_case26', 'test_case27', 'test_case28',
            'test_case29', 'test_case30', 'test_case31', 'test_case32'
        ]

        unittest.TestSuite.__init__(self, map(TestWorker, tests))


def all_suite_worker():
    return unittest.TestSuite([SuiteWorker()])


if __name__ == '__main__':
    job_path = '/root/repository/pysilhouette_svn/job/'

    os.environ['PYSILHOUETTE_CONF'] = '/etc/pysilhouette/silhouette.conf'
    cf = readconf(os.environ['PYSILHOUETTE_CONF'])
    pysilhouette.log.reload_conf(cf["env.sys.log.conf.path"])

    ok_f_cmd = (u'python /root/pysilhouette/pysilhouette/job/sendmail.py'
                u' --from="root@localhost"'
                u' --to="root@localhost"'
                u' --subject="Results of Worker(%s)"'
                u' --hostname="localhost"'
                u' --port="25"'
                u' --msg="%s"'
                u' --charset="utf-8"')

    ng_f_cmd = (u'python /root/pysilhouette/pysilhouette/job/sendmail_dummy.py'
                u' --from="root@localhost"'
                u' --to="root@localhost"'
                u' --subject="Results of Worker(%s)"'
Example #6
0
def main():
    global opts

    (opts, args) = getopts()
    if chkopts(opts) is True:
        return PROCERROR
    
    ####
    try:
        opts.config = os.path.abspath(opts.config)
    except AttributeError, e:
        print >>sys.stderr, 'No configuration file path.'
        return PROCERROR
    
    cf = readconf(opts.config)
    if cf is None:
        print >>sys.stderr, 'Failed to load the config file "%s". (%s)' % (opts.config, sys.argv[0])
        return PROCERROR

    # conf parse
    if parse_conf(cf) is False:
        return PROCERROR
    
    if reload_conf(cf["env.sys.log.conf.path"]):
        logger = logging.getLogger('pysilhouette.silhouette')
    else:
        print >>sys.stderr, 'Failed to load the log file. (%s)' % sys.argv[0]
        return PROCERROR

    if opts.uniqkey: