Project

Profile

Help

Issue #2703

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

Added by fdobrovo over 2 years ago. Updated 6 months ago.

Status:
MODIFIED
Priority:
High
Category:
-
Sprint/Milestone:
Start date:
Due date:
Severity:
2. Medium
Version:
Platform Release:
Blocks Release:
OS:
Backwards Incompatible:
No
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
QA Contact:
Complexity:
Smash Test:
Verified:
No
Verification Required:
No
Sprint:

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 environment MODIFIED Actions

Associated revisions

Revision e072177e View on GitHub
Added by amacdona@redhat.com over 2 years ago

Pass virtualenv to db-reset

Since Django is installed in a virtual environment, it should should be
activated before manage.py commands are run.

closes #2708

History

#1 Updated by amacdona@redhat.com over 2 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to amacdona@redhat.com

#2 Updated by ttereshc over 2 years ago

  • Triaged changed from No to Yes

#3 Updated by amacdona@redhat.com over 2 years ago

  • Blocks Task #2742: As a developer, Pulp, Plugins, and python dependencies are installed into a single virtual environment added

#4 Updated by amacdona@redhat.com over 2 years ago

  • Status changed from ASSIGNED to POST

#5 Updated by amacdona@redhat.com over 2 years ago

  • Status changed from POST to MODIFIED

#6 Updated by daviddavis 6 months ago

  • Sprint/Milestone set to 3.0

#7 Updated by bmbouter 6 months ago

  • Tags deleted (Pulp 3)

Please register to edit this issue

Also available in: Atom PDF