

def handle(self, request, data):
    try:
        namespace = glance.metadefs_namespace_create(request, data['namespace'])
        messages.success(request, (_('Namespace %s has been created.') % namespace['namespace']))
        return namespace
    except Exception as e:
        msg = _('Unable to create new namespace. %s')
        msg %= e.message.split('Failed validating', 1)[0]
        exceptions.handle(request, message=msg)
        return False

dataset/ETHPy150Open openstack/horizon/openstack_dashboard/dashboards/admin/metadata_defs/forms.py CreateNamespaceForm.handle/original