Skip to content

Commit da34e9d

Browse files
Fixed permanent delete failing live tests (Azure#15829)
1 parent fb74a7a commit da34e9d

File tree

3 files changed

+29
-39
lines changed

3 files changed

+29
-39
lines changed

sdk/storage/azure-storage-blob/azure/storage/blob/_models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ class RetentionPolicy(GeneratedRetentionPolicy):
196196
"""
197197

198198
def __init__(self, enabled=False, days=None):
199-
super(RetentionPolicy, self).__init__(enabled=enabled, days=days, allow_permanent_delete=False)
199+
super(RetentionPolicy, self).__init__(enabled=enabled, days=days, allow_permanent_delete=None)
200200
if self.enabled and (self.days is None):
201201
raise ValueError("If policy is enabled, 'days' must be specified.")
202202

sdk/storage/azure-storage-blob/tests/recordings/test_blob_service_properties.test_blob_service_properties.yaml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ interactions:
1616
Content-Type:
1717
- application/xml; charset=utf-8
1818
User-Agent:
19-
- azsdk-python-storage-blob/12.0.0b5 Python/3.6.3 (Windows-10-10.0.18362-SP0)
19+
- azsdk-python-storage-blob/12.7.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0)
2020
x-ms-date:
21-
- Fri, 25 Oct 2019 17:53:49 GMT
21+
- Wed, 16 Dec 2020 19:00:37 GMT
2222
x-ms-version:
23-
- '2019-02-02'
23+
- '2020-04-08'
2424
method: PUT
2525
uri: https://storagename.blob.core.windows.net/?restype=service&comp=properties
2626
response:
@@ -30,11 +30,11 @@ interactions:
3030
content-length:
3131
- '0'
3232
date:
33-
- Fri, 25 Oct 2019 17:53:49 GMT
33+
- Wed, 16 Dec 2020 19:00:41 GMT
3434
server:
3535
- Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0
3636
x-ms-version:
37-
- '2019-02-02'
37+
- '2020-04-08'
3838
status:
3939
code: 202
4040
message: Accepted
@@ -48,28 +48,32 @@ interactions:
4848
Connection:
4949
- keep-alive
5050
User-Agent:
51-
- azsdk-python-storage-blob/12.0.0b5 Python/3.6.3 (Windows-10-10.0.18362-SP0)
51+
- azsdk-python-storage-blob/12.7.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0)
5252
x-ms-date:
53-
- Fri, 25 Oct 2019 17:53:49 GMT
53+
- Wed, 16 Dec 2020 19:00:42 GMT
5454
x-ms-version:
55-
- '2019-02-02'
55+
- '2020-04-08'
5656
method: GET
5757
uri: https://storagename.blob.core.windows.net/?restype=service&comp=properties
5858
response:
5959
body:
6060
string: "\uFEFF<?xml version=\"1.0\" encoding=\"utf-8\"?><StorageServiceProperties><Logging><Version>1.0</Version><Read>false</Read><Write>false</Write><Delete>false</Delete><RetentionPolicy><Enabled>false</Enabled></RetentionPolicy></Logging><HourMetrics><Version>1.0</Version><Enabled>false</Enabled><RetentionPolicy><Enabled>false</Enabled></RetentionPolicy></HourMetrics><MinuteMetrics><Version>1.0</Version><Enabled>false</Enabled><RetentionPolicy><Enabled>false</Enabled></RetentionPolicy></MinuteMetrics><Cors
61-
/><DeleteRetentionPolicy><Enabled>false</Enabled></DeleteRetentionPolicy><StaticWebsite><Enabled>false</Enabled></StaticWebsite><DefaultServiceVersion>2014-02-14</DefaultServiceVersion></StorageServiceProperties>"
61+
/><DeleteRetentionPolicy><Enabled>true</Enabled><Days>365</Days><AllowPermanentDelete>false</AllowPermanentDelete></DeleteRetentionPolicy><StaticWebsite><Enabled>false</Enabled></StaticWebsite><DefaultServiceVersion>2014-02-14</DefaultServiceVersion></StorageServiceProperties>"
6262
headers:
63+
access-control-allow-origin:
64+
- '*'
65+
access-control-expose-headers:
66+
- x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,Content-Length,Date,Transfer-Encoding
6367
content-type:
6468
- application/xml
6569
date:
66-
- Fri, 25 Oct 2019 17:53:49 GMT
70+
- Wed, 16 Dec 2020 19:00:41 GMT
6771
server:
6872
- Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0
6973
transfer-encoding:
7074
- chunked
7175
x-ms-version:
72-
- '2019-02-02'
76+
- '2020-04-08'
7377
status:
7478
code: 200
7579
message: OK

sdk/storage/azure-storage-blob/tests/recordings/test_blob_service_properties_async.test_blob_service_properties.yaml

Lines changed: 13 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10,64 +10,50 @@ interactions:
1010
Content-Type:
1111
- application/xml; charset=utf-8
1212
User-Agent:
13-
- azsdk-python-storage-blob/12.0.0b5 Python/3.6.3 (Windows-10-10.0.18362-SP0)
13+
- azsdk-python-storage-blob/12.7.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0)
1414
x-ms-date:
15-
- Fri, 25 Oct 2019 17:57:12 GMT
15+
- Wed, 16 Dec 2020 19:02:02 GMT
1616
x-ms-version:
17-
- '2019-02-02'
17+
- '2020-04-08'
1818
method: PUT
1919
uri: https://storagename.blob.core.windows.net/?restype=service&comp=properties
2020
response:
2121
body:
2222
string: ''
2323
headers:
2424
content-length: '0'
25-
date: Fri, 25 Oct 2019 17:57:12 GMT
25+
date: Wed, 16 Dec 2020 19:02:02 GMT
2626
server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0
27-
x-ms-version: '2019-02-02'
27+
x-ms-version: '2020-04-08'
2828
status:
2929
code: 202
3030
message: Accepted
31-
url: !!python/object/new:yarl.URL
32-
state: !!python/tuple
33-
- !!python/object/new:urllib.parse.SplitResult
34-
- https
35-
- pyacrstorageidjk2ou5leed.blob.core.windows.net
36-
- /
37-
- restype=service&comp=properties
38-
- ''
31+
url: https://seanmcccanary3.blob.core.windows.net/?restype=service&comp=properties
3932
- request:
4033
body: null
4134
headers:
4235
Accept:
4336
- application/xml
4437
User-Agent:
45-
- azsdk-python-storage-blob/12.0.0b5 Python/3.6.3 (Windows-10-10.0.18362-SP0)
38+
- azsdk-python-storage-blob/12.7.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0)
4639
x-ms-date:
47-
- Fri, 25 Oct 2019 17:57:12 GMT
40+
- Wed, 16 Dec 2020 19:02:03 GMT
4841
x-ms-version:
49-
- '2019-02-02'
42+
- '2020-04-08'
5043
method: GET
5144
uri: https://storagename.blob.core.windows.net/?restype=service&comp=properties
5245
response:
5346
body:
5447
string: "\uFEFF<?xml version=\"1.0\" encoding=\"utf-8\"?><StorageServiceProperties><Logging><Version>1.0</Version><Read>false</Read><Write>false</Write><Delete>false</Delete><RetentionPolicy><Enabled>false</Enabled></RetentionPolicy></Logging><HourMetrics><Version>1.0</Version><Enabled>false</Enabled><RetentionPolicy><Enabled>false</Enabled></RetentionPolicy></HourMetrics><MinuteMetrics><Version>1.0</Version><Enabled>false</Enabled><RetentionPolicy><Enabled>false</Enabled></RetentionPolicy></MinuteMetrics><Cors
55-
/><DeleteRetentionPolicy><Enabled>false</Enabled></DeleteRetentionPolicy><StaticWebsite><Enabled>false</Enabled></StaticWebsite><DefaultServiceVersion>2014-02-14</DefaultServiceVersion></StorageServiceProperties>"
48+
/><DeleteRetentionPolicy><Enabled>true</Enabled><Days>365</Days><AllowPermanentDelete>false</AllowPermanentDelete></DeleteRetentionPolicy><StaticWebsite><Enabled>false</Enabled></StaticWebsite><DefaultServiceVersion>2014-02-14</DefaultServiceVersion></StorageServiceProperties>"
5649
headers:
5750
content-type: application/xml
58-
date: Fri, 25 Oct 2019 17:57:12 GMT
51+
date: Wed, 16 Dec 2020 19:02:02 GMT
5952
server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0
6053
transfer-encoding: chunked
61-
x-ms-version: '2019-02-02'
54+
x-ms-version: '2020-04-08'
6255
status:
6356
code: 200
6457
message: OK
65-
url: !!python/object/new:yarl.URL
66-
state: !!python/tuple
67-
- !!python/object/new:urllib.parse.SplitResult
68-
- https
69-
- pyacrstorageidjk2ou5leed.blob.core.windows.net
70-
- /
71-
- restype=service&comp=properties
72-
- ''
58+
url: https://seanmcccanary3.blob.core.windows.net/?restype=service&comp=properties
7359
version: 1

0 commit comments

Comments
 (0)