GitHub user Kami opened a pull request:
https://github.com/apache/libcloud/pull/127
[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.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/Kami/libcloud pricing_file_changes
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/libcloud/pull/127.patch
----
----