Pricing guide documents a custom file path that the loader ignores
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 88/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- documentation
Research direction
Open docs/compute/pricing.rst and review the “Using a custom pricing file” and “Updating pricing” sections cited in the issue. Correct the custom pricing path to match the loader, and align the download-source description with the current default noted in the issue. Done when all three path references and the outdated source description accurately reflect those defaults.
Written by the indexing model from the issue text.
Description
Summary
The pricing guide tells users to put custom pricing in ~/.libcloud.pricing.json, but Libcloud reads ~/.libcloud/pricing.json. Following the documented setup leaves the custom data unused.
At current trunk 8a0ef6260680625d54fce5093d2315e0926a7dc9, the incorrect path appears twice under Using a custom pricing file and once under Updating pricing in docs/compute/pricing.rst.
Detailed Information
Reproduced with Python 3.12 on Linux using unchanged Libcloud 4.0.0.dev0. This uses temporary directories and fresh subprocesses, so an existing home-directory file or in-memory pricing cache does not affect the result. No cloud service or pricing-data download is involved.
import json
import os
import subprocess
import sys
import tempfile
from pathlib import Path
probe = '''
from libcloud import pricing
path = pricing.get_pricing_file_path()
print("selected", "custom" if path == pricing.CUSTOM_PRICING_FILE_PATH else "bundled")
try:
print("price", pricing.get_size_price("compute", "local_probe", "small"))
except KeyError:
print("custom driver unavailable")
'''
with tempfile.TemporaryDirectory() as tmp:
home = Path(tmp)
content = json.dumps({"compute": {"local_probe": {"small": 0.125}}, "storage": {}})
(home / ".libcloud.pricing.json").write_text(content)
env = dict(os.environ, HOME=tmp)
subprocess.run([sys.executable, "-c", probe], env=env, check=True)
# selected bundled
# custom driver unavailable
(home / ".libcloud").mkdir()
(home / ".libcloud" / "pricing.json").write_text(content)
subprocess.run([sys.executable, "-c", probe], env=env, check=True)
# selected custom
# price 0.125
The expected documentation path is ~/.libcloud/pricing.json, matching CUSTOM_PRICING_FILE_PATH, get_pricing_file_path() and the existing upgrade notes. With the documented dot-separated path, the loader silently falls back to bundled data; for this synthetic custom-only driver the lookup then raises KeyError.
The Updating pricing paragraph also says the default download source is the git repository, while the function currently defaults to DEFAULT_FILE_URL_S3_BUCKET; the preceding section already describes that S3 service. It would be useful to bring that paragraph into line with the current defaults at the same time.
This is a documentation report, not a change to actual prices or a claim about provider billing. No full test suite or live download was run.
- Dominant language
- Python
- Stars
- 2.1k
- Forks
- 935
- Avg merge
- 5d 3h
- Merged PRs (30d)
- 15
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/libcloud
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Local range download leaves an output file after source-read failure despite delete_on_failure=TrueOpen
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
apache/libcloud#2215 · 3 comments · 2 reactions ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
Maintainers usually reply within 1 day
Similar issues
-
Email validation accepts a trailing newlinePossibly taken @marcello-pichini claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
dbt-labs/spark-utils#51 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
bug frontend
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
vendrabuck/HERD#1419 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day