From ea9687c30bd55f812f337942aea22cd3c81d1e8a Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Tue, 15 Sep 2020 23:37:39 +0200 Subject: [PATCH] core: don't fail migrations if no pbadmin exists --- .../{vmware-vsphere => vmware-vcenter}/index.md | 10 +++++++--- .../passbook_setup.png | Bin .../vcenter_post_setup.png | Bin mkdocs.yml | 2 +- passbook/core/migrations/0009_group_is_superuser.py | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) rename docs/integrations/services/{vmware-vsphere => vmware-vcenter}/index.md (93%) rename docs/integrations/services/{vmware-vsphere => vmware-vcenter}/passbook_setup.png (100%) rename docs/integrations/services/{vmware-vsphere => vmware-vcenter}/vcenter_post_setup.png (100%) diff --git a/docs/integrations/services/vmware-vsphere/index.md b/docs/integrations/services/vmware-vcenter/index.md similarity index 93% rename from docs/integrations/services/vmware-vsphere/index.md rename to docs/integrations/services/vmware-vcenter/index.md index 24819d169..3180a6388 100644 --- a/docs/integrations/services/vmware-vsphere/index.md +++ b/docs/integrations/services/vmware-vcenter/index.md @@ -1,6 +1,6 @@ -# VMware vSphere Integration +# VMware vCenter Integration -## What is vSphere +## What is vCenter From https://en.wikipedia.org/wiki/VCenter @@ -12,6 +12,10 @@ From https://en.wikipedia.org/wiki/VCenter This requires passbook 0.10.3 or newer. +!!! warning + + This requires VMware vCenter 7.0.0 or newer. + ## Preparation The following placeholders will be used: @@ -23,7 +27,7 @@ Since vCenter only allows OpenID-Connect in combination with Active Directory, i ### Step 1 -Under *Property Mappings*, create a *Scope Mapping*. Give it a name like "OIDC-Scope-VMware-vSphere". Set the scope name to `openid` and the expression to the following +Under *Property Mappings*, create a *Scope Mapping*. Give it a name like "OIDC-Scope-VMware-vCenter". Set the scope name to `openid` and the expression to the following ```python return { diff --git a/docs/integrations/services/vmware-vsphere/passbook_setup.png b/docs/integrations/services/vmware-vcenter/passbook_setup.png similarity index 100% rename from docs/integrations/services/vmware-vsphere/passbook_setup.png rename to docs/integrations/services/vmware-vcenter/passbook_setup.png diff --git a/docs/integrations/services/vmware-vsphere/vcenter_post_setup.png b/docs/integrations/services/vmware-vcenter/vcenter_post_setup.png similarity index 100% rename from docs/integrations/services/vmware-vsphere/vcenter_post_setup.png rename to docs/integrations/services/vmware-vcenter/vcenter_post_setup.png diff --git a/mkdocs.yml b/mkdocs.yml index f473fb26b..14d0a194b 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -52,7 +52,7 @@ nav: - Harbor: integrations/services/harbor/index.md - Sentry: integrations/services/sentry/index.md - Ansible Tower/AWX: integrations/services/tower-awx/index.md - - VMware vSphere: integrations/services/vmware-vsphere/index.md + - VMware vCenter: integrations/services/vmware-vcenter/index.md - Upgrading: - to 0.9: upgrading/to-0.9.md - to 0.10: upgrading/to-0.10.md diff --git a/passbook/core/migrations/0009_group_is_superuser.py b/passbook/core/migrations/0009_group_is_superuser.py index 95fbe9f9a..2884e1dc2 100644 --- a/passbook/core/migrations/0009_group_is_superuser.py +++ b/passbook/core/migrations/0009_group_is_superuser.py @@ -13,7 +13,7 @@ def create_default_admin_group(apps: Apps, schema_editor: BaseDatabaseSchemaEdit group, _ = Group.objects.using(db_alias).get_or_create( is_superuser=True, defaults={"name": "passbook Admins",} ) - group.users.add(User.objects.get(username="pbadmin")) + group.users.set(User.objects.filter(username="pbadmin")) group.save()