Esempio n. 1
0
    def create_software_config(self, cnxt, group, name, config,
                               inputs, outputs, options):

        swc_io.check_io_schema_list(inputs)
        in_conf = [swc_io.InputConfig(**i).as_dict() for i in inputs]
        swc_io.check_io_schema_list(outputs)
        out_conf = [swc_io.OutputConfig(**o).as_dict() for o in outputs]

        sc = software_config_object.SoftwareConfig.create(cnxt, {
            'group': group,
            'name': name,
            'config': {
                rpc_api.SOFTWARE_CONFIG_INPUTS: in_conf,
                rpc_api.SOFTWARE_CONFIG_OUTPUTS: out_conf,
                rpc_api.SOFTWARE_CONFIG_OPTIONS: options,
                rpc_api.SOFTWARE_CONFIG_CONFIG: config
            },
            'tenant': cnxt.tenant_id})
        return api.format_software_config(sc)
Esempio n. 2
0
 def test_check_io_schema_empty_list(self):
     swc_io.check_io_schema_list([])
Esempio n. 3
0
 def test_check_io_schema_list_dict(self):
     swc_io.check_io_schema_list([{'name': 'foo'}])
Esempio n. 4
0
 def test_check_io_schema_list_dict(self):
     swc_io.check_io_schema_list([{"name": "foo"}])