Pricing guide documents a custom file path that the loader ignores
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 1/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 88/100
- Issue 類型
- 文件
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
研究方向
開啟 docs/compute/pricing.rst,檢視 issue 中提到的「Using a custom pricing file」和「Updating pricing」章節。修正自訂價格檔案的路徑,使其與載入器一致,並將下載來源的說明與 issue 中註明的目前預設值保持一致。完成標準是,所有三處路徑參照和過時的下載來源說明都準確反映這些預設值。
由索引模型根據 Issue 內容生成。
描述
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.
- 主要語言
- Python
- 星號
- 2.1k
- 分支
- 935
- 平均合併
- 5 天 3 小時
- 30 天內合併 PR
- 15
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
apache/libcloud 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 76/100
維護者通常 1 天內回覆
-
Local range download leaves an output file after source-read failure despite delete_on_failure=True未關閉
難度 2/5 1-3 小時 新手友好度 82/100
維護者通常 1 天內回覆
-
難度 5/5 一週以上 新手友好度 15/100
apache/libcloud#2215 · 3 則留言 · 2 個 reaction ·
維護者通常 1 天內回覆
-
難度 5/5 一週以上 新手友好度 35/100
維護者通常 1 天內回覆
-
難度 5/5 一週以上 新手友好度 15/100
維護者通常 1 天內回覆
相似的 Issue
-
Email validation accepts a trailing newline可能已有人在做 @marcello-pichini 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
dbt-labs/spark-utils#51 ·
-
難度 2/5 1-3 小時 新手友好度 85/100
維護者通常 1 天內回覆
-
bug frontend
難度 2/5 1-3 小時 新手友好度 88/100
vendrabuck/HERD#1419 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆