apache/libcloud — pull request #127 by Kami (2013-07-30 15:42:02+00:00)
Title: [RFC] Command line utility for updating pricing file

This branch adds a command line tool for updating pricing file (as discussed in the last design day). It includes the following changes:

1. Modifies the pricing code, to read pricing data from `~/.libcloud/pricing.json` file, if it exists. If it doesn't it reads it from a pricing file which is bundled with a libcloud distribution.
2. Adds a command line tool to download the latest pricing file from our git repository and saves it to `~/.libcloud/pricing.json`

Example CLI tool usage:

```bash
$ libcloud update-pricing [--file-path=~/.libcloud/pricing.json] [--file-url=...]
```

The tool is non-interactive (so it can be used in a cronjob, etc) and it's very simple. It doesn't perform any update checks and it simply overwrites the file at `~/.libcloud/pricing.json`.

Since the pricing file is small, the current approach is imo totally fine. Adding extra code to handle "only update if necessary" by using hash comparison / modified-at or similar approach would imo just add unnecessary complexity with very little benefit.