Last change
on this file since 841 was
841,
checked in by jripsl, 11 years ago
|
- add static class initialisation function.
|
-
Property svn:executable set to
*
|
File size:
1.1 KB
|
Rev | Line | |
---|
[840] | 1 | #!/usr/bin/python -u |
---|
| 2 | # -*- coding: ISO-8859-1 -*- |
---|
| 3 | |
---|
| 4 | ################################## |
---|
| 5 | # @program smon |
---|
| 6 | # @description simulation monitor |
---|
| 7 | # @copyright Copyright â(c)2009 Centre National de la Recherche Scientifique CNRS. |
---|
| 8 | # All Rights Reservedâ |
---|
| 9 | # @svn_file $Id: failover 2545 2013-02-01 09:58:10Z jripsl $ |
---|
| 10 | # @version $Rev: 2545 $ |
---|
| 11 | # @lastrevision $Date: 2013-02-01 10:58:10 +0100 (Fri, 01 Feb 2013) $ |
---|
| 12 | # @license CeCILL (http://dods.ipsl.jussieu.fr/jripsl/smon/LICENSE) |
---|
| 13 | ################################## |
---|
| 14 | |
---|
| 15 | from smon import dao |
---|
| 16 | |
---|
| 17 | class Failover(): |
---|
[841] | 18 | |
---|
| 19 | @classmethod |
---|
| 20 | def controlLoop(cls): |
---|
| 21 | simulation=dao.get_simulation() |
---|
| 22 | |
---|
| 23 | pass |
---|
[840] | 24 | |
---|
| 25 | def main(): |
---|
| 26 | |
---|
| 27 | # parse args |
---|
| 28 | parser = argparse.ArgumentParser(prog='failover') |
---|
| 29 | parser.add_argument('-v', dest='verbose',required=False,action='store_true') |
---|
| 30 | args = parser.parse_args() |
---|
| 31 | |
---|
| 32 | # check |
---|
| 33 | if not os.path.exists(SMON.smon_home): |
---|
| 34 | sys.exit(1) |
---|
| 35 | |
---|
[841] | 36 | SMON.init_singleton() |
---|
[840] | 37 | |
---|
[841] | 38 | Failover.controlLoop() |
---|
[840] | 39 | |
---|
[841] | 40 | SMON.free_singleton() |
---|
[840] | 41 | |
---|
| 42 | |
---|
| 43 | if __name__ == '__main__': |
---|
| 44 | try: |
---|
| 45 | main() |
---|
| 46 | |
---|
| 47 | sys.exit(0) |
---|
| 48 | |
---|
| 49 | except Exception, e: |
---|
| 50 | |
---|
| 51 | #traceback.print_exc() |
---|
| 52 | |
---|
| 53 | sys.exit(1) |
---|
Note: See
TracBrowser
for help on using the repository browser.