Commit graph

11 commits

Author SHA1 Message Date
Aleksey Zhukov
b7d644d484 Fix broken cache logic 2015-05-14 09:42:48 +03:00
Aleksey Zhukov
3861597696 Bring back cache 2015-05-13 18:12:48 +03:00
Aleksey Zhukov
0d3e015dd1 Update DigitalOcean dynamic inventory to API v2 2015-05-07 22:53:10 +03:00
Christian Berendt
6676720ce5 fixed typos found by RETF rules in PY files
rules are avaialble at https://en.wikipedia.org/wiki/Wikipedia:AutoWikiBrowser/Typos
2014-05-03 18:40:05 +02:00
Timur Batyrshin
658c15930e reword "except Error as e:" into "except Error, e:" to be compatible with Python 2.5 (#5852) 2014-02-03 13:00:40 -06:00
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.
2013-08-09 11:57:37 -04:00
Evan Wies
98bbf9708a digital_ocean: whitespace changes 2013-07-05 10:38:04 -04:00
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.
2013-07-05 10:00:01 -04:00
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
2013-07-02 15:49:43 -04:00
Evan Wies
01c9e7ea88 digital_ocean: add --env to inventory script 2013-06-27 14:52:32 -04:00
Evan Wies
807f3e76db Add DigitalOcean inventory plugin
Intended to complement the recently added digital_ocean module.
2013-06-26 23:01:30 -04:00