Uploaded image for project: 'CORD'
  1. CORD
  2. CORD-1556

Create a method to seed basic models to bootstrap the system

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Resolved (View Workflow)
    • Priority: Medium
    • Resolution: Done
    • Affects Version/s: 4.0
    • Fix Version/s: 4.0
    • Component/s: XOS
    • Labels:

      Description

      Wee need to create a "Site" and a "User" associated with it in order to operate the system.
      Historically this was done via TOSCA, but the new implementation use the gRPC APIs to communicate with the core, thus will require the user to be already present.

      The plan to solve this is:

      • move the migrations from xos-ui to xos-core (still using django for now: "python manage.py makemigrations")
      • create a tempalte to generate a Django fixture in the cord-config step from platform-install (https://docs.djangoproject.com/en/1.11/howto/initial-data/)
      • load the fixture before starting the core apis ("python manage.py loaddata <path-to-fixture>")
      • start the core APIs

      NOTE: assume someone has changed the admin user or site, and then the Core container is restarted. We want to make sure it doesn't revert the objects back to their original values. "loaddata" may not be the best way to achieve this, migrations can work better: https://docs.djangoproject.com/en/1.11/howto/initial-data/#providing-initial-data-with-migrations

        Attachments

          Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Activity

              People

              Assignee:
              teone Matteo Scandolo
              Reporter:
              teone Matteo Scandolo
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes