Is `maas-cli machine` expected to work with the new maas-cli?

Has anyone had any success using the “new” maas-cli to retrieve machine details? The old CLI worked great, but this new one seems to fail if the machine has any tags:

$ maas-cli  machine vm-003-7246 
Error: sequence item 0: expected str instance, Tag found

$ maas-cli machine --format json vm-003-7246 
Error: Object of type 'Tags.Managed#Machine' is not JSON serializable

$ maas-cli machine --format yaml vm-003-7246 
Error: ('cannot represent an object', <Tags.Managed#Machine length=2 items=[<Tag name='virtual' (unloaded)>, <Tag name='pod-console-logging' (unloaded)>]>)

I’m using the latest CLI available via snap on Ubuntu 20.04, if that’s relevant:

$ snap info maas-cli
name:      maas-cli
summary:   CLI to communicate with a MAAS region
publisher: Canonical✓
store-url: https://snapcraft.io/maas-cli
license:   unset
description: |
  CLI to communicate with a MAAS region providing total automation of your
  physical servers for amazing data center operational efficiency.
commands:
  - maas-cli
snap-id:      cVypVLwI10HsLmjT0VlJ2SETxKTkcEdt
tracking:     latest/stable
refresh-date: 2 days ago, at 22:48 EDT
channels:
  latest/stable:    0.6.5 2019-10-04 (13) 14MB -
  latest/candidate: ↑                          
  latest/beta:      ↑                          
  latest/edge:      0.6.5 2019-10-03 (13) 14MB -
installed:          0.6.5            (13) 14MB -

I see that even this “latest” version looks pretty old. Is this tool still supported? (If not, what should I be using instead?)

@nturner, i don’t use maas-cli – i just use maas, with a command something like this:

mass $PROFILE machine read $SYSTEM_ID

will that help you at all?

Thanks @billwear. On Ubuntu 20.04, /usr/bin/maas is a shell script that calls /snap/bin/maas (and tells you to install the snap version of the CLI if you haven’t).

(For what it’s worth, I was able to work around this by refactoring my tools to use the python3-libmaas library directly instead of calling the CLI.)

1 Like

got it. glad you found a handle.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.