Skip to content

Commit d274fcf

Browse files
authored
Merge pull request #301 from oracle/release_2020-10-30
Releasing version 2.23.3
2 parents b32733b + 9923ffb commit d274fcf

File tree

6 files changed

+202
-3
lines changed

6 files changed

+202
-3
lines changed

CHANGELOG.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ Change Log
33
All notable changes to this project will be documented in this file.
44

55
The format is based on `Keep a Changelog <http://keepachangelog.com/>`_.
6+
====================
7+
2.23.3 - 2020-10-29
8+
====================
9+
10+
Fixed
11+
-------
12+
* Fixed an issue where `UploadManager.upload_stream()` raised `MultipartUploadError` if the time to upload is greater than the read timeout. Please see `github issue #300 <https://github.com/oracle/oci-python-sdk/issues/300>`_ for more details.
13+
614
====================
715
2.23.2 - 2020-10-27
816
====================

docs/known-issues.rst

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,20 @@ Known Issues
44
~~~~~~~~~~~~~~~~~~~~~~
55
These are the current known issues for the Python SDK.
66

7+
UploadManager.upload_stream() raises MultipartUploadError in oci v2.23.2
8+
========================================================================
9+
`UploadManager.upload_stream() <https://docs.cloud.oracle.com/en-us/iaas/tools/python/2.23.2/api/upload_manager.html#oci.object_storage.UploadManager.upload_stream>`_ raises MultipartUploadError when a timeout is set on the underlying object storage client, and the operation takes more than the read timeout to complete. Prior to v2.23.2, we were overwriting the timeout to None in the operations (please see this `known issue <https://docs.cloud.oracle.com/en-us/iaas/tools/python/2.23.2/known-issues.html#uploadmanager-generates-ssl3-write-pending-error-when-a-read-timeout-is-set-for-the-object-storage-client>`_). The default timeout is a read timeout of 60 seconds, hence this scenario will be triggered by default in v2.23.2 on any use of this operation where the operation takes 60 or more seconds to complete.
10+
You can work around the issue by explicitly setting the timeout to None. For example,
11+
12+
.. code-block:: python
13+
14+
client.base_client.timeout = None
15+
16+
This issue has been fixed in oci v2.23.3
17+
718
UploadManager generates ssl3_write_pending error when a read timeout is set for the Object Storage client
819
=========================================================================================================
9-
**Update:** This issue has been fixed in v2.23.2. This issue still may exist with using Python versions < 2.7.9. If you do encounter this issue, please consult the workaround mentioned below.
20+
**Update:** This issue has partially been fixed in v2.23.2. This issue still may exist with using Python versions < 2.7.9. If you do encounter this issue, please consult the workaround mentioned below.
1021

1122
**Update:** With v2.18.0 we handle the object storage client with default timeout values (connect timeout = 10 secs and read timeout = 60 secs), by overwriting the timeout to `None` in the operations.
1223

Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
# coding: utf-8
2+
# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
3+
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
4+
5+
# This example creates a new loadbalancer with SSL cipher suites. After that it creates a new listener with the SSL configuration and updates the backend set with it. Finally it updates the loadbalancer cipher suites and deletes it in the end.
6+
7+
import oci
8+
import argparse
9+
10+
# ---------- parse arguments
11+
parser = argparse.ArgumentParser()
12+
parser.add_argument('--compartment-id',
13+
help='compartment ID in which to perform the operation',
14+
required=True
15+
)
16+
parser.add_argument('--subnet-id',
17+
help='subnet ID in which the load balancer will be created',
18+
required=True
19+
)
20+
parser.add_argument('--display-name',
21+
help='display name for the load balancer to be created',
22+
required=False,
23+
default='python-sdk-create-lb-example'
24+
)
25+
parser.add_argument('--shape-name',
26+
help='shape name of the load balancer to be created',
27+
required=False,
28+
default='100Mbps'
29+
)
30+
args = parser.parse_args()
31+
32+
# ---------- certificate keys
33+
cert_private_key = """-----BEGIN RSA PRIVATE KEY-----### the content of your private key ###-----END RSA PRIVATE KEY-----"""
34+
cert_public_key = """-----BEGIN CERTIFICATE-----### the content of your certificate ###-----END CERTIFICATE-----"""
35+
cert_password = "password of your certificate"
36+
37+
# ---------- assign provided arguments
38+
compartment_id = args.compartment_id
39+
subnet_id = args.subnet_id
40+
display_name = args.display_name
41+
shape_name = args.shape_name
42+
43+
# ---------- read config from file
44+
config = oci.config.from_file()
45+
load_balancer_client = oci.load_balancer.LoadBalancerClient(config)
46+
load_balancer_client_composite_ops = oci.load_balancer.LoadBalancerClientCompositeOperations(load_balancer_client)
47+
48+
print('Create new Load Balancer')
49+
print('\n================================\n')
50+
# ---------- create load balancer
51+
load_balancer = load_balancer_client_composite_ops.create_load_balancer_and_wait_for_state(
52+
oci.load_balancer.models.CreateLoadBalancerDetails(
53+
compartment_id=compartment_id,
54+
display_name=display_name,
55+
shape_name=shape_name,
56+
subnet_ids=[subnet_id],
57+
backend_sets={
58+
'backend1': oci.load_balancer.models.BackendSetDetails(
59+
policy='ROUND_ROBIN',
60+
health_checker=oci.load_balancer.models.HealthCheckerDetails(
61+
protocol='HTTP',
62+
url_path='/',
63+
port=80,
64+
retries=1,
65+
timeout_in_millis=100,
66+
interval_in_millis=1000
67+
),
68+
session_persistence_configuration=oci.load_balancer.models.SessionPersistenceConfigurationDetails(
69+
cookie_name='*',
70+
disable_fallback=False
71+
)
72+
),
73+
'backend2': oci.load_balancer.models.BackendSetDetails(
74+
policy='ROUND_ROBIN',
75+
health_checker=oci.load_balancer.models.HealthCheckerDetails(
76+
protocol='HTTP',
77+
url_path='/testurl2',
78+
port=80,
79+
retries=1,
80+
timeout_in_millis=100,
81+
interval_in_millis=1000
82+
)
83+
)
84+
},
85+
ssl_cipher_suites={
86+
'test-suite': oci.load_balancer.models.SSLCipherSuiteDetails(
87+
name='test-suite',
88+
ciphers=["ECDHE-RSA-AES256-GCM-SHA384", "ECDHE-ECDSA-AES256-GCM-SHA384", "ECDHE-RSA-AES128-GCM-SHA256"]
89+
)
90+
}
91+
92+
),
93+
[oci.load_balancer.models.WorkRequest.LIFECYCLE_STATE_SUCCEEDED]
94+
)
95+
96+
load_balancer_ocid = load_balancer.data.id
97+
98+
print('Created Load Balancer %s' % (load_balancer_ocid))
99+
print('\n================================\n')
100+
101+
print('Create new certificate')
102+
print('\n================================\n')
103+
load_balancer_client_composite_ops.create_certificate_and_wait_for_state(
104+
oci.load_balancer.models.CreateCertificateDetails(
105+
certificate_name='example-certificate',
106+
public_certificate=cert_public_key,
107+
passphrase=cert_password,
108+
private_key=cert_private_key,
109+
ca_certificate=cert_public_key
110+
),
111+
load_balancer_ocid,
112+
wait_for_states=[oci.load_balancer.models.WorkRequest.LIFECYCLE_STATE_SUCCEEDED]
113+
)
114+
115+
print('Create new listener with ssl configuration')
116+
print('\n================================\n')
117+
load_balancer_client_composite_ops.create_listener_and_wait_for_state(
118+
oci.load_balancer.models.CreateListenerDetails(
119+
name='listener1',
120+
default_backend_set_name='backend1',
121+
port=8080,
122+
protocol='HTTP',
123+
ssl_configuration=oci.load_balancer.models.SSLConfigurationDetails(
124+
certificate_name='example-certificate',
125+
cipher_suite_name='test-suite',
126+
protocols=["TLSv1.1", "TLSv1.2"],
127+
server_order_preference="ENABLED",
128+
verify_peer_certificate=True
129+
)
130+
),
131+
load_balancer_ocid,
132+
wait_for_states=[oci.load_balancer.models.WorkRequest.LIFECYCLE_STATE_SUCCEEDED]
133+
)
134+
135+
print('Update backend sets with sslconfig')
136+
print('\n================================\n')
137+
load_balancer_client_composite_ops.update_backend_set_and_wait_for_state(
138+
oci.load_balancer.models.UpdateBackendSetDetails(
139+
policy='ROUND_ROBIN',
140+
health_checker=oci.load_balancer.models.HealthCheckerDetails(
141+
protocol='HTTP',
142+
url_path='/testurl2',
143+
port=80,
144+
retries=1,
145+
timeout_in_millis=100,
146+
interval_in_millis=1000
147+
),
148+
ssl_configuration=oci.load_balancer.models.SSLConfigurationDetails(
149+
certificate_name='example-certificate',
150+
cipher_suite_name='test-suite',
151+
protocols=["TLSv1.1"],
152+
verify_peer_certificate=False
153+
),
154+
backends=[]
155+
),
156+
load_balancer_ocid,
157+
'backend1',
158+
wait_for_states=[oci.load_balancer.models.WorkRequest.LIFECYCLE_STATE_SUCCEEDED]
159+
)
160+
161+
print('Update ssl cipher suite')
162+
print('\n================================\n')
163+
load_balancer_client_composite_ops.update_ssl_cipher_suite_and_wait_for_state(
164+
oci.load_balancer.models.UpdateSSLCipherSuiteDetails(
165+
ciphers=["DHE-DSS-AES256-SHA256", "CAMELLIA256-SHA"]
166+
),
167+
load_balancer_ocid,
168+
'test-suite',
169+
wait_for_states=[oci.load_balancer.models.WorkRequest.LIFECYCLE_STATE_SUCCEEDED]
170+
)
171+
172+
print("Attempting to delete load balancer {}".format(load_balancer_ocid))
173+
print('\n================================\n')
174+
load_balancer_client_composite_ops.delete_load_balancer_and_wait_for_state(
175+
load_balancer_ocid,
176+
wait_for_states=[oci.load_balancer.models.WorkRequest.LIFECYCLE_STATE_SUCCEEDED])
177+
print('Deleted Load Balancer')

src/oci/object_storage/transfer/internal/multipart_object_assembler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ def _upload_stream_part(self, part_num, part_bytes, **kwargs):
482482
self.manifest["objectName"],
483483
self.manifest["uploadId"],
484484
part_num + 1, # Internally this is 0-based but object storage is 1-based
485-
part_bytes,
485+
io.BytesIO(part_bytes),
486486
**new_kwargs
487487
)
488488
except Exception as e:

src/oci/regions.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
'sjc': 'us-sanjose-1',
2222
'fra': 'eu-frankfurt-1',
2323
'zrh': 'eu-zurich-1',
24+
'cwl': 'uk-cardiff-1',
2425
'lhr': 'uk-london-1',
2526
'yyz': 'ca-toronto-1',
2627
'nrt': 'ap-tokyo-1',
@@ -57,6 +58,7 @@
5758
'eu-zurich-1': 'oc1',
5859
'me-dubai-1': 'oc1',
5960
'me-jeddah-1': 'oc1',
61+
'uk-cardiff-1': 'oc1',
6062
'uk-london-1': 'oc1',
6163
'ca-toronto-1': 'oc1',
6264
'sa-saopaulo-1': 'oc1',
@@ -99,6 +101,7 @@
99101
"eu-zurich-1",
100102
"me-dubai-1",
101103
"me-jeddah-1",
104+
"uk-cardiff-1",
102105
"uk-london-1",
103106
"uk-gov-cardiff-1",
104107
"ca-toronto-1",

src/oci/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
33
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
44

5-
__version__ = "2.23.2"
5+
__version__ = "2.23.3"

0 commit comments

Comments
 (0)