maas-cli calls into regiond and rackd code
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
MAAS | Status tracked in 3.6 | |||||
3.5 |
Won't Fix
|
Low
|
Unassigned | |||
3.6 |
Triaged
|
Low
|
Unassigned |
Bug Description
I tried using the maas-cli from the Debian packages and was unable to. This ended up being due to a change I was testing but exposed an issue with the maas-cli, it calls into rackd and regiond. This explains why even a simple --help takes 2 seconds. The maas-cli should be completely independent from MAAS.
$ time maas --help
usage: maas [-h] COMMAND ...
optional arguments:
-h, --help show this help message and exit
drill down:
COMMAND
login Log in to a remote API, and remember its description and credentials.
logout Log out of a remote API, purging any stored credentials.
list List remote APIs that have been logged-in to.
refresh Refresh the API descriptions of all profiles.
init Initialize controller.
apikey Used to manage a user's API keys. Shows existing keys unless --generate or --delete
configauth Configure external authentication.
createadmin Create a MAAS administrator account.
changepassword
maas Interact with http://
real 0m2.024s
user 0m1.880s
sys 0m0.144s
$ maas --help
Traceback (most recent call last):
File "/usr/bin/maas", line 11, in <module>
load_
File "/usr/lib/
parser = prepare_
File "/usr/lib/
register_
File "/usr/lib/
django_setup()
File "/usr/lib/
apps.
File "/usr/lib/
app_
File "/usr/lib/
self.
File "/usr/lib/
return _bootstrap.
File "<frozen importlib.
File "<frozen importlib.
File "<frozen importlib.
File "<frozen importlib.
File "<frozen importlib.
File "<frozen importlib.
File "/usr/lib/
from maasserver.models import signals # noqa:E402 isort:skip
File "/usr/lib/
from maasserver.
File "/usr/lib/
from metadataserver.
File "/usr/lib/
from metadataserver.
File "/usr/lib/
from metadataserver.
File "/usr/lib/
from maasserver.
File "/usr/lib/
from maasserver.
File "/usr/lib/
from maasserver.
File "/usr/lib/
from provisioningser
File "/usr/lib/
from provisioningser
File "/usr/lib/
load_registry()
File "/usr/lib/
with ClusterConfigur
File "/usr/lib/
return next(self.gen)
File "/usr/lib/
with cls.backend.
File "/usr/lib/
return next(self.gen)
File "/usr/lib/
touch(path)
File "/usr/lib/
os.
PermissionError: [Errno 13] Permission denied: '/etc/maas/
Changed in maas: | |
milestone: | 3.5.0 → 3.5.x |
maas-cli detects whether the region controller code is available, in which case it adds the "init" command and other django-related commands that we expose from the region.
To do that, it has to call Django setup code.
Ideally we should have entirely separate commands for the CLI and MAAS management.