Comment 2 for bug 1782329

Revision history for this message
Alex Kavanagh (ajkavanagh) wrote :

On a xenial with lxd 2.x:

In [5]: c.host_info['config']
Out[5]:
{u'core.https_address': u'[::]',
 u'core.proxy_ignore_hosts': u'127.0.0.1,::1,localhost',
 u'core.trust_password': True,
 u'storage.zfs_pool_name': u'lxd'}

On bionic with lxd 3.0.1:

In [8]: c.host_info['config']
Out[8]:
{u'core.https_address': u'[::]',
 u'core.proxy_ignore_hosts': u'127.0.0.1,::1,localhost',
 u'core.trust_password': True}

Looks like the deprecated key has been removed from the lxd 3.x.

To fix it will need to patch in some code to just grab the first storage pool if the key doesn't exist.

Testing in an ipython shell, shows that this should do the trick:

    c = pylxd.Client()
    try:
        name = lxd_config['config']['storage.zfs_pool_name']
    except KeyError:
        name = c.storage_pools.all()[0].name

I'll do some testing to see if it works.