Skip to content

Commit 2891faf

Browse files
committed
chore: remove Region.from_region_id backup domain qbox and s3
1 parent 0dbde38 commit 2891faf

File tree

2 files changed

+9
-33
lines changed

2 files changed

+9
-33
lines changed

qiniu/http/region.py

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ class ServiceName(Enum):
1717
RS = 'rs'
1818
RSF = 'rsf'
1919
API = 'api'
20-
S3 = 's3'
2120

2221

2322
class Region:
@@ -77,34 +76,25 @@ def from_region_id(region_id, **kwargs):
7776
services_hosts = {
7877
ServiceName.UC: ['uc.qiniuapi.com'],
7978
ServiceName.UP: [
80-
# TODO(lihs): backend seems mark qbox.me to old
81-
'up-{0}.qiniup.com'.format(region_id),
82-
'up-{0}.qbox.me'.format(region_id)
79+
'upload-{0}.qiniup.com'.format(region_id),
80+
'up-{0}.qiniup.com'.format(region_id)
8381
] if not is_z0 else [
84-
'up.qiniup.com',
85-
'up.qbox.me'
82+
'upload.qiniup.com',
83+
'up.qiniup.com'
8684
],
8785
ServiceName.IO: [
8886
'iovip-{0}.qiniuio.com'.format(region_id),
89-
'iovip-{0}.qbox.me'.format(region_id)
9087
] if not is_z0 else [
9188
'iovip.qiniuio.com',
92-
'iovip.qbox.me'
9389
],
9490
ServiceName.RS: [
9591
'rs-{0}.qiniuapi.com'.format(region_id),
96-
'rs-{0}.qbox.me'.format(region_id)
9792
],
9893
ServiceName.RSF: [
9994
'rsf-{0}.qiniuapi.com'.format(region_id),
100-
'rsf-{0}.qbox.me'.format(region_id)
10195
],
10296
ServiceName.API: [
10397
'api-{0}.qiniuapi.com'.format(region_id),
104-
'api-{0}.qbox.me'.format(region_id)
105-
],
106-
ServiceName.S3: [
107-
's3.{0}.qiniucs.com'.format(region_id),
10898
]
10999
}
110100
services = {

tests/cases/test_http/test_region.py

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -48,28 +48,21 @@ def test_from_region_id(self):
4848
'https://uc.qiniuapi.com'
4949
],
5050
ServiceName.UP: [
51-
'https://up.qiniup.com',
52-
'https://up.qbox.me'
51+
'https://upload.qiniup.com',
52+
'https://up.qiniup.com'
5353
],
5454
ServiceName.UP_ACC: [],
5555
ServiceName.IO: [
5656
'https://iovip.qiniuio.com',
57-
'https://iovip.qbox.me'
5857
],
5958
ServiceName.RS: [
6059
'https://rs-z0.qiniuapi.com',
61-
'https://rs-z0.qbox.me'
6260
],
6361
ServiceName.RSF: [
6462
'https://rsf-z0.qiniuapi.com',
65-
'https://rsf-z0.qbox.me'
6663
],
6764
ServiceName.API: [
6865
'https://api-z0.qiniuapi.com',
69-
'https://api-z0.qbox.me'
70-
],
71-
ServiceName.S3: [
72-
'https://s3.z0.qiniucs.com'
7366
]
7467
}
7568

@@ -109,28 +102,21 @@ def test_from_region_id_with_custom_options(self):
109102
preferred_scheme + '://uc.qiniuapi.com'
110103
],
111104
ServiceName.UP: [
112-
preferred_scheme + '://up-z1.qiniup.com',
113-
preferred_scheme + '://up-z1.qbox.me'
105+
preferred_scheme + '://upload-z1.qiniup.com',
106+
preferred_scheme + '://up-z1.qiniup.com'
114107
],
115108
ServiceName.UP_ACC: [],
116109
ServiceName.IO: [
117110
preferred_scheme + '://iovip-z1.qiniuio.com',
118-
preferred_scheme + '://iovip-z1.qbox.me'
119111
],
120112
ServiceName.RS: [
121113
preferred_scheme + '://rs-z1.qiniuapi.com',
122-
preferred_scheme + '://rs-z1.qbox.me'
123114
],
124115
ServiceName.RSF: [
125116
preferred_scheme + '://rsf-z1.qiniuapi.com',
126-
preferred_scheme + '://rsf-z1.qbox.me'
127117
],
128118
ServiceName.API: [
129119
preferred_scheme + '://api-z1.qiniuapi.com',
130-
preferred_scheme + '://api-z1.qbox.me'
131-
],
132-
ServiceName.S3: [
133-
preferred_scheme + '://s3.z1.qiniucs.com'
134120
],
135121
'custom-service': [
136122
custom_service_endpoint.get_value()
@@ -156,7 +142,7 @@ def test_clone(self):
156142
cloned_region.region_id = 'another'
157143
cloned_region.services[ServiceName.UP][0].host = 'another-uc.qiniuapi.com'
158144
assert region.region_id == 'z0'
159-
assert region.services[ServiceName.UP][0].get_value() == 'https://up.qiniup.com'
145+
assert region.services[ServiceName.UP][0].get_value() == 'https://upload.qiniup.com'
160146
assert cloned_region.services[ServiceName.UP][0].get_value() == 'https://another-uc.qiniuapi.com'
161147

162148
def test_merge(self):

0 commit comments

Comments
 (0)