'Return a Parameter Schema object from a legacy schema dictionary.
:param param_name: name of the parameter owning the schema; used
for more verbose logging
:type  param_name: str'

@classmethod
def from_dict(cls, param_name, schema_dict):

    cls._validate_dict(param_name, schema_dict)
    def constraints():
        constraints = schema_dict.get(cls.CONSTRAINTS)
        if (constraints is None):
            return
        if (not isinstance(constraints, list)):
            raise exception.InvalidSchemaError(message=(_('Invalid    parameter    constraints    for    parameter    %s,    expected    a    list') % param_name))
        for constraint in constraints:
            cls._check_dict(constraint, PARAM_CONSTRAINTS, 'parameter    constraints')
            (yield cls._constraint_from_def(constraint))
    return cls(schema_dict[cls.TYPE], description=schema_dict.get(HOTParamSchema.DESCRIPTION), default=schema_dict.get(HOTParamSchema.DEFAULT), constraints=list(constraints()), hidden=schema_dict.get(HOTParamSchema.HIDDEN, False), label=schema_dict.get(HOTParamSchema.LABEL), immutable=schema_dict.get(HOTParamSchema.IMMUTABLE, False))
