'Serialize non-string metadata values before sending them to Nova.'

def meta_serialize(self, metadata):

    if (not isinstance(metadata, collections.Mapping)):
        raise exception.StackValidationFailed(message=_('nova    server    metadata    needs    to    be    a    Map.'))
    return dict(((key, (value if isinstance(value, six.string_types) else jsonutils.dumps(value))) for (key, value) in metadata.items()))
