Project

Profile

Help

Issue #2703

closed

db-reset.sh when called during vagrant up isn't working

Added by fdobrovo over 7 years ago. Updated almost 5 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
High
Category:
-
Sprint/Milestone:
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:

Description

The db-reset.sh doesn't properly work during provisioning this leads to unmigrated database after vagrant up. After that one have to be in virtualenv to make the script work.

TASK [dev : Initialize Pulp DB] ************************************************
changed: [dev] => {
    "changed": true, 
    "cmd": [
        "/home/vagrant/devel/pulp/app/pulp/app/db-reset.sh"
    ], 
    "delta": "0:00:01.063070", 
    "end": "2017-04-12 16:44:18.684091", 
    "invocation": {
        "module_args": {
            "_raw_params": "/home/vagrant/devel/pulp/app/pulp/app/db-reset.sh", 
            "_uses_shell": false, 
            "chdir": null, 
            "creates": null, 
            "executable": null, 
            "removes": null, 
            "warn": true
        }, 
        "module_name": "command"
    }, 
    "rc": 0, 
    "start": "2017-04-12 16:44:17.621021", 
    "stderr": "Traceback (most recent call last):\n  File \"manage.py\", line 8, in <module>\n    from django.core.management import execute_from_command_line\nImportError: No module named django.core.management\nTraceback (most recent call last):\n  File \"manage.py\", line 8, in <module>\n    from django.core.management import execute_from_command_line\nImportError: No module named django.core.management\nTraceback (most recent call last):\n  File \"manage.py\", line 8, in <module>\n    from django.core.management import execute_from_command_line\nImportError: No module named django.core.management\nTraceback (most recent call last):\n  File \"manage.py\", line 8, in <module>\n    from django.core.management import execute_from_command_line\nImportError: No module named django.core.management", 
    "stdout": "~/devel/pulp/app/pulp/app ~\nPlatform 'migrations' dir already exists (/home/vagrant/devel/pulp/app/pulp/app/migrations)\nIf resetting the DB fails, migrations for pulp apps (including platform)\nmay need to be removed for the DB reset to succeed.\n~", 
    "stdout_lines": [
        "~/devel/pulp/app/pulp/app ~", 
        "Platform 'migrations' dir already exists (/home/vagrant/devel/pulp/app/pulp/app/migrations)", 
        "If resetting the DB fails, migrations for pulp apps (including platform)", 
        "may need to be removed for the DB reset to succeed.", 
        "~"
    ], 
    "warnings": []
}

stderr:

Traceback (most recent call last):
  File "manage.py", line 8, in <module>
    from django.core.management import execute_from_command_line
ImportError: No module named django.core.management
Traceback (most recent call last):
  File "manage.py", line 8, in <module>
    from django.core.management import execute_from_command_line
ImportError: No module named django.core.management
Traceback (most recent call last):
  File "manage.py", line 8, in <module>
    from django.core.management import execute_from_command_line
ImportError: No module named django.core.management
Traceback (most recent call last):
  File "manage.py", line 8, in <module>
    from django.core.management import execute_from_command_line
ImportError: No module named django.core.management

Script:
https://github.com/pulp/pulp/blob/3.0-dev/app/pulp/app/db-reset.sh
Ansible task:
https://github.com/pulp/devel/blob/3.0-dev/ansible/roles/dev/tasks/main.yml

Debugged by:

ansible.verbose = "vvv"

Related issues

Blocks Pulp - Task #2742: As a developer, Pulp, Plugins, and python dependencies are installed into a single virtual environmentCLOSED - CURRENTRELEASEamacdona@redhat.com

Actions

Also available in: Atom PDF