Merge ~blake-rouse/maas:fix-venv-services into maas:master

Proposed by Blake Rouse
Status: Merged
Approved by: Blake Rouse
Approved revision: 649b3f0dfeb1957a056dce1d73404df090aacd68
Merge reported by: MAAS Lander
Merged at revision: not available
Proposed branch: ~blake-rouse/maas:fix-venv-services
Merge into: maas:master
Diff against target: 88 lines (+9/-7)
4 files modified
Makefile (+2/-5)
services/regiond/run (+1/-0)
src/maasserver/region_script.py (+3/-1)
src/provisioningserver/rack_script.py (+3/-1)
Reviewer Review Type Date Requested Status
MAAS Lander Approve
Alberto Donato (community) Approve
Review via email: mp+373820@code.launchpad.net

Commit message

Fix issues with running services and commands with the new venv.

To post a comment you must log in.
Revision history for this message
Alberto Donato (ack) wrote :

+1 with a comment

review: Approve
Revision history for this message
Blake Rouse (blake-rouse) :
Revision history for this message
MAAS Lander (maas-lander) wrote :

UNIT TESTS
-b fix-venv-services lp:~blake-rouse/maas/+git/maas into -b master lp:~maas-committers/maas

STATUS: SUCCESS
COMMIT: 51217cd0c875b9eb2c0c5c37502f1a88bfd3d2ed

review: Approve
~blake-rouse/maas:fix-venv-services updated
649b3f0... by Blake Rouse

Remove the lazy import wrappers.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/Makefile b/Makefile
2index 33663e9..1948ed1 100644
3--- a/Makefile
4+++ b/Makefile
5@@ -46,8 +46,6 @@ export MAAS_ROOT := $(CURDIR)/.run
6 # For things that care, postgresfixture for example, we always want to
7 # use the "maas" databases.
8 export PGDATABASE := maas
9-# Don't perform permission/group checks in maas commands
10-export MAAS_DEVENV := 1
11
12 # Check if a command is found on PATH. Raise an error if not, citing
13 # the package to install. Return the command otherwise.
14@@ -77,7 +75,6 @@ build: \
15 bin/test.parallel \
16 bin/postgresfixture \
17 bin/py \
18- bin/ipy \
19 machine-resources \
20 pycharm
21 .PHONY: build
22@@ -121,8 +118,8 @@ bin/flake8 bin/coverage \
23 mkdir -p bin
24 ln -sf ../$(VENV)/$@ $@
25
26-bin/py bin/ipy:
27- ln -sf ../$(VENV)/$@thon $@
28+bin/py:
29+ ln -sf ../$(VENV)/bin/ipython $@
30
31 # bin/flake8 is needed for checking lint and bin/node-sass is needed for
32 # checking css.
33diff --git a/services/regiond/run b/services/regiond/run
34index 42e0c10..24c235e 100755
35--- a/services/regiond/run
36+++ b/services/regiond/run
37@@ -27,6 +27,7 @@ fi
38 export MAAS_DNS_CONFIG_DIR="$(readlink -f run/named)"
39 export MAAS_DNS_RNDC_PORT=5246
40 export MAAS_DNS_DEFAULT_CONTROLS=0
41+export DJANGO_SETTINGS_MODULE="maasserver.djangosettings.development"
42
43 # Exec the MAAS API and Web UI Server.
44 script="$(readlink -f bin/regiond)"
45diff --git a/src/maasserver/region_script.py b/src/maasserver/region_script.py
46index 7bbc072..de9815d 100644
47--- a/src/maasserver/region_script.py
48+++ b/src/maasserver/region_script.py
49@@ -4,6 +4,8 @@
50 import grp
51 import os
52
53+from provisioningserver.config import is_dev_environment
54+
55
56 def check_user():
57 # At present, only root should execute this.
58@@ -58,7 +60,7 @@ def run_django(is_snap, is_devenv):
59
60 def run():
61 is_snap = 'SNAP' in os.environ
62- is_devenv = os.environ.get('MAAS_DEVENV') == '1'
63+ is_devenv = is_dev_environment()
64 if not is_devenv:
65 check_user()
66 if not is_snap:
67diff --git a/src/provisioningserver/rack_script.py b/src/provisioningserver/rack_script.py
68index 0dc0d6d..0a713d8 100644
69--- a/src/provisioningserver/rack_script.py
70+++ b/src/provisioningserver/rack_script.py
71@@ -6,6 +6,8 @@ import os
72 import pwd
73 import sys
74
75+from provisioningserver.config import is_dev_environment
76+
77
78 def check_users(users):
79 """Check that the runnig user is in users."""
80@@ -37,7 +39,7 @@ def set_umask():
81
82 def run():
83 is_snap = 'SNAP' in os.environ
84- is_devenv = os.environ.get('MAAS_DEVENV') == '1'
85+ is_devenv = is_dev_environment()
86
87 if not is_devenv:
88 if is_snap:

Subscribers

People subscribed via source and target branches