Exemplo n.º 1
0
 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'])
Exemplo n.º 2
0
 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'])
Exemplo n.º 3
0
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]
Exemplo n.º 4
0
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]
Exemplo n.º 5
0
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']
Exemplo n.º 6
0
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']