def test_load_with_empty_yaml_document(self): '''Test loading with empty YAML document in flow.''' self.cfg = MilkCheckConfig() self.cfg.load_from_stream('''--- # This is en empty document. --- services: S1: desc: "I'm the service S1" variables: LUSTRE_FS_LIST: store0,work0 target: "%s" actions: start: check: [ status ] cmd: shine mount -q -L -f $LUSTRE_FS_LIST stop: cmd: shine umount -q -L -f $LUSTRE_FS_LIST status: cmd : shine status -q -L -f $LUSTRE_FS_LIST check: check: [ status ]''' % HOSTNAME) self.cfg.build_graph() self.assertTrue(self.cfg._flow) self.assertTrue(len(self.cfg._flow) == 1)
def load_config(self, conf): ''' Load the configuration within the manager thanks to MilkCheckConfig ''' from MilkCheck.Config.Configuration import MilkCheckConfig config = MilkCheckConfig() config.load_from_dir(directory=conf) config.build_graph()
def setUp(self): self.cfg = MilkCheckConfig()