''boot-resources'' command doesn't exist ?

Mike Pontillo mike.pontillo at canonical.com
Mon Feb 20 20:07:28 UTC 2017


On Sat, Feb 18, 2017 at 11:13 AM, Amira Hamila <hamilaemira at gmail.com>
wrote:

>
> *when  I try using the "boot-resources'' command, this error message shows
> up :*
>
> usage: /usr/lib/python2.7/dist-packages/maascli/__main__.py admin
>        [-h] COMMAND ...
>
> Issue commands to the MAAS region controller at http://10.0.2.15:5240/MAAS/api/1.0/.
>
> optional arguments:
>   -h, --help   show this help message and exit
>
> drill down:
>   COMMAND
>     files      Manage the collection of all the files in this MAAS.
>     node-groups
>                Manage the collection of all the nodegroups in this MAAS.
>     nodes      Manage the collection of all the nodes in the MAAS.
>     version    Information about this MAAS instance.
>
> This is a profile.  Any commands you issue on this profile will
> operate on the MAAS region server.
>
> The command information you see here comes from the region server's
> API; it may differ for different profiles.  If you believe the API may
> have changed, use the command's 'refresh' sub-command to fetch the
> latest version of this help information from the server.
>
> argument COMMAND: invalid choice: u'boot-resources' (choose from 'files', 'node-groups', 'nodes', 'version')
>
> *Any idea why? *
>
>
This is puzzling; I tried on a fresh install of MAAS 1.9.4 and I don't see
the problem on my machine. I suggest you file a bug[1]. I have the
following ideas and questions, which the bug report would need to try to
address:

(1) MAAS uses the Python files as metadata to generate a description of the
API, which the API client uses to determine which commands are available.
The following commands, (when run on the MAAS server), should tell us if
those files are still intact:

    sudo apt-get install -yu debsums
    debsums -s $(dpkg --get-selections | grep maas | awk '{print $1}')

(2) The following command (when run on the MAAS server) should JSON
consisting of a complete description of the API:

    curl http://localhost:5240/MAAS/api/1.0/describe/ | gzip -c >
api_description.gz

When you file a bug, please attach the 'api_description.gz' file. If you
don't mind attaching your "$HOME/.maascli.db" file as well, that would also
help (though that will contain your API keys, so don't do that unless you
don't mind that everyone on the internet will get those).

(3) Just curious if you can upgrade to MAAS 2.x (running on Ubuntu 16.04);
MAAS has evolved significantly since 1.9.x, and MAAS 2.x and has been the
primary beneficiary of development and maintenance effort for some time now.

(4) When we went from MAAS 1.x to MAAS 2.x, (and from supporting MAAS
primarily on Ubuntu 14.04 to Ubuntu 16.04), we also moved from Python 2.x
to Python 3.x. One big difference between Python 2 and 3 is how Python
deals with character encodings. I wonder if something in your environment
(maybe $LANG or similar) on the MAAS client or server is causing the
expected character encoding to differ from the actual character encoding;
if so, I wonder if this might cause the API description to be truncated.
When you file a bug, please include as much of the output of the `env`
command as you can (both on the MAAS server and on the client), so that we
can determine if this issue has to do with language options or default
character encodings. I'm leaning toward this NOT being the issue; I ran the
following command on a MAAS 1.9 test bed:

for file in $(dpkg -L python-django-maas | grep '\.py$'); do python3 -c "f
= open(\"$file\", 'rb'); f.read().decode('ascii');" || echo "$file"; done

   ... and convinced myself that none of the files containing the API
description have non-ASCII characters in them. (there is only one
file, /usr/lib/python2.7/dist-packages/maasserver/utils/dbtasks.py, which
should not affect the API.)

(5) If you are using the MAAS CLI on a remote machine, please try using it
on the MAAS server itself and check if the issue persists.

Regards,
Mike

https://bugs.launchpad.net/maas/+filebug
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/maas-devel/attachments/20170220/742e2531/attachment.html>


More information about the Maas-devel mailing list