# Path: ironicclient/exc.py
# class AmbiguousAuthSystem(exceptions.ClientException):
# class InvalidAttribute(exceptions.ClientException):
# class StateTransitionFailed(exceptions.ClientException):
# class StateTransitionTimeout(exceptions.ClientException):
# def from_response(response, message=None, traceback=None, method=None,
#                   url=None):


import functools
import json
import jsonschema
import yaml
from ironicclient import exc
                "type": "object"
            }
        },
        "nodes": {
            "type": "array",
            "items": {
                "type": "object"
            }
        }
    },
    "additionalProperties": False
}


def create_resources(client, filenames):
    """Create resources using their JSON or YAML descriptions.

    :param client: an instance of ironic client;
    :param filenames: a list of filenames containing JSON or YAML resources
        definitions.
    :raises: ClientException if any operation during files processing/resource
        creation fails.
    """
    errors = []
    resources = []
    for resource_file in filenames:
        try:
            resource = load_from_file(resource_file)
            jsonschema.validate(resource, _CREATE_SCHEMA)
            resources.append(resource)

# Path: ironicclient/exc.py
# class AmbiguousAuthSystem(exceptions.ClientException):
# class InvalidAttribute(exceptions.ClientException):
# class StateTransitionFailed(exceptions.ClientException):
# class StateTransitionTimeout(exceptions.ClientException):
# def from_response(response, message=None, traceback=None, method=None,
#                   url=None):


# Path: ironicclient/v1/create_resources.py
import functools
import json
import jsonschema
import yaml
from ironicclient import exc

                "type": "object"
            }
        },
        "nodes": {
            "type": "array",
            "items": {
                "type": "object"
            }
        }
    },
    "additionalProperties": False
}


def create_resources(client, filenames):
    """Create resources using their JSON or YAML descriptions.

    :param client: an instance of ironic client;
    :param filenames: a list of filenames containing JSON or YAML resources
        definitions.
    :raises: ClientException if any operation during files processing/resource
        creation fails.
    """
    errors = []
    resources = []
    for resource_file in filenames:
        try:
            resource = load_from_file(resource_file)
            jsonschema.validate(resource, _CREATE_SCHEMA)
            resources.append(resource)

        except (exc.ClientException, jsonschema.ValidationError) as e: