def test_device_type_parser(self): jinja2_path = jinja_template_path(system=False) self.assertTrue(os.path.exists(jinja2_path)) data = load_devicetype_template('beaglebone-black', system_path=False) self.assertIsNotNone(data) self.assertIn('actions', data) self.assertIn('deploy', data['actions']) self.assertIn('boot', data['actions'])
def deploy_methods(device_type, methods): data = load_devicetype_template(device_type) if not data or 'actions' not in data or methods not in data['actions']: return None methods = data['actions'][methods]['methods'] if isinstance(methods, dict): return methods.keys() return [methods]
def device_type_timeouts(device_type): data = load_devicetype_template(device_type) if not data or 'timeouts' not in data: return None return data['timeouts']