[Patchew-devel] [PATCH 6/6] server: Use postgres in Docker deploy

Paolo Bonzini pbonzini at redhat.com
Thu Nov 1 08:19:32 UTC 2018


On 01/11/2018 07:34, Fam Zheng wrote:
> On Wed, 10/31 14:32, Paolo Bonzini wrote:
>> On 31/10/2018 02:28, Fam Zheng wrote:
>>> -    elif os.environ.get("PATCHEW_TEST"):
>>> -        # Test environment
>>> -        return True, os.environ.get("PATCHEW_TEST_DATA_DIR")
>>> +        data_dir = os.path.join(os.environ.get("VIRTUAL_ENV",
>>> +                                               "/var/tmp/patchew-dev"),
>>> +                                "data")
>>> +        return (True, data_dir,
>>> +            {
>>> +                'default': {
>>> +                    'ENGINE': 'django.db.backends.sqlite3',
>>> +                    'NAME': os.path.join(data_dir, "patchew-db.sqlite3"),
>>> +                    }
>>
>> Why drop the PATCHEW_TEST case?
> 
> Because it's unreachable when venv is used, and it seems the idea is reversed in
> the first place and is therefore wrong. The env var is set by
> tests/patchewtest.py, but this piece of code can run before that, by
> ./manage.py.

Oh, I see.  Thanks!

Paolo




More information about the Patchew-devel mailing list