Conditions | 2 |
Total Lines | 21 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | """ |
||
32 | def main(self, filename): |
||
33 | """ |
||
34 | The main function of load_schedule. |
||
35 | |||
36 | :param str filename: The filename with the XML definition of the host. |
||
37 | """ |
||
38 | |||
39 | try: |
||
40 | DataLayer.connect() |
||
41 | |||
42 | reader = XmlReader() |
||
43 | host = reader.parse_host(filename) |
||
44 | host.store() |
||
45 | |||
46 | DataLayer.commit() |
||
47 | DataLayer.disconnect() |
||
48 | except Exception as exception: |
||
49 | DataLayer.rollback() |
||
50 | DataLayer.disconnect() |
||
51 | |||
52 | raise exception |
||
53 | |||
55 |