Comment 0 for bug 1806763

Revision history for this message
Jason Hobbs (jason-hobbs) wrote :

After adding a boot source, there is nothing to indicate that the boot source's information has been synced into maas's db and maas is ready to allow boot source selections to be made.

In this log, I try to make a boot source selection immediately after adding a boot source, and it fails. If I way another 20 seconds and try again, it works. But, there is nothing to read from the API that says "ok, you can make a boot source selection." So, I just have to add a 'sleep', which is racy.

ubuntu@staging-cpe-84e78778-1c0d-4f7b-b73b-3933b6b23033:~/cpe/foundation$ maas root boot-sources create url=http://images.maas.io/ephemeral-v3/daily/ keyring_filename=/usr/share/keyrings/ubuntu-cloudimage-keyring.gpg; maas root boot-source-selections create 4 os="ubuntu" release="xenial" arches="amd64" subarches="*" labels="*"
Success.
Machine-readable output follows:
{
    "created": "2018-12-04T21:05:37.160",
    "url": "http://images.maas.io/ephemeral-v3/daily/",
    "keyring_data": "",
    "resource_uri": "/MAAS/api/2.0/boot-sources/4/",
    "updated": "2018-12-04T21:05:37.160",
    "keyring_filename": "/usr/share/keyrings/ubuntu-cloudimage-keyring.gpg",
    "id": 4
}
{"os": ["OS ubuntu with release xenial has no available images for download"]}
ubuntu@staging-cpe-84e78778-1c0d-4f7b-b73b-3933b6b23033:~/cpe/foundation$ maas root boot-source-selections create 4 os="ubuntu" release="xenial" arches="amd64" subarches="*" labels="*"
Success.
Machine-readable output follows:
{
    "release": "xenial",
    "labels": [
        "*"
    ],
    "arches": [
        "amd64"
    ],
    "id": 4,
    "boot_source_id": 4,
    "os": "ubuntu",
    "resource_uri": "/MAAS/api/2.0/boot-sources/4/selections/4/",
    "subarches": [
        "*"
    ]
}