Skip to content

Commit 3e31475

Browse files
authored
Merge pull request #480 from ydb-platform/update_examples_certs
Add root_certificates to driver init in examples
2 parents 1c2a7b2 + 5849cee commit 3e31475

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

examples/basic_example_v1/basic_example.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,12 @@ def ensure_path_exists(driver, database, path):
360360

361361

362362
def run(endpoint, database, path):
363-
with ydb.Driver(endpoint=endpoint, database=database, credentials=ydb.credentials_from_env_variables()) as driver:
363+
with ydb.Driver(
364+
endpoint=endpoint,
365+
database=database,
366+
credentials=ydb.credentials_from_env_variables(),
367+
root_certificates=ydb.load_ydb_root_certificate(),
368+
) as driver:
364369
driver.wait(timeout=5, fail_fast=True)
365370

366371
with ydb.SessionPool(driver) as pool:

examples/basic_example_v2/basic_example.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ def run(endpoint, database):
243243
endpoint=endpoint,
244244
database=database,
245245
credentials=ydb.credentials_from_env_variables(),
246+
root_certificates=ydb.load_ydb_root_certificate(),
246247
) as driver:
247248
driver.wait(timeout=5, fail_fast=True)
248249

examples/basic_example_v2/basic_example_async.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ async def run(endpoint, database):
242242
endpoint=endpoint,
243243
database=database,
244244
credentials=ydb.credentials_from_env_variables(),
245+
root_certificates=ydb.load_ydb_root_certificate(),
245246
) as driver:
246247
await driver.wait(timeout=5, fail_fast=True)
247248

0 commit comments

Comments
 (0)