Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix api of uphost and mark region config is optional (ucloud#15)
BUGFIX:

- Mark `region` config is optional
- Update field `CPUSet` at the model `PHostSetSchema`
  • Loading branch information
yufeiminds authored Sep 24, 2019
commit 5647df41ebd8c9d757886f897872bf357cf78d68
4 changes: 2 additions & 2 deletions ucloud/core/client/_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

class ConfigSchema(schema.Schema):
fields = {
"region": fields.Str(required=True),
"region": fields.Str(),
"project_id": fields.Str(),
"base_url": fields.Str(default="https://api.ucloud.cn"),
"user_agent": fields.Str(),
Expand Down Expand Up @@ -46,7 +46,7 @@ class Config:

def __init__(
self,
region: str,
region: str = None,
project_id: str = None,
base_url: str = "https://api.ucloud.cn",
user_agent: str = None,
Expand Down
2 changes: 1 addition & 1 deletion ucloud/core/client/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,4 @@ def _build_user_agent(self) -> str:
return user_agent

def __repr__(self):
return '<{}("{}")>'.format(self.__class__.__name__, self.config.region)
return '<{}(region="{}")>'.format(self.__class__.__name__, self.config.region)
Loading