Allow to specify the probed cloud stacks with -c cloud[,cloud...]

This commit is contained in:
reykfloeter 2019-06-04 18:09:50 +02:00
commit ca22cba8e4
7 changed files with 210 additions and 85 deletions

View file

@ -31,11 +31,14 @@
static int openstack_fetch(struct system_config *);
int
openstack(struct system_config *sc)
{
return tryendpoint(sc, openstack_fetch, cloudinit);
if (sc->sc_state == STATE_INIT) {
sc->sc_state = STATE_DHCP;
return (-1);
}
return openstack_fetch(sc);
}
static int
@ -53,7 +56,6 @@ openstack_fetch(struct system_config *sc)
if ((json = metadata(sc,
"/openstack/latest/meta_data.json", TEXT)) == NULL)
goto fail;
sc->sc_stack = "openstack";
if ((j = json_parse(json, strlen(json))) == NULL)
goto fail;