Commit Graph

6 Commits (7fa0d8bdd35fa0667d274df3fe6c6748a46fb45f)

Author SHA1 Message Date
Evan Wies 0c9c4ae401 digital_ocean #3438: use get instead of [] to prevent KeyError
The existing code was using:
  a[b][c[d]]
where a[b] would always exist and c[d] would always exist.
But the nested index would not alway exist, particularly when a DigitalOcean item disapeared.

This changes that nested index to a `get` and properly handles None results.

This bug was present in two spots in this file.
11 years ago
Evan Wies 98bbf9708a digital_ocean: whitespace changes 12 years ago
Evan Wies 9b1a57f1f3 digital_ocean: make sure 'images' includes non-global images
The `dopy` library function all_images includes a 'global' filter
by default.  This was preventing private images from showing up
in --images.

The problem also made this script fail immediately for people
who had droplets previously created with private images.
12 years ago
Evan Wies 3f6bc3f664 digital_ocean.py enhancements
* Always refresh droplet information (versus getting it from cache) for
  --list, --host, --droplets, and --all.   All the DigitalOcean calls are
  pretty fast and without this change, inventory was often stale/incorrect.
  For example, previously if you destroyed a droplet, the inventory
  script would still find it and attempt to act on it.

* Added --force-cache option

* Added some option shortcuts -d, -r

* Added more value sanitization
12 years ago
Evan Wies 01c9e7ea88 digital_ocean: add --env to inventory script 12 years ago
Evan Wies 807f3e76db Add DigitalOcean inventory plugin
Intended to complement the recently added digital_ocean module.
12 years ago