@@ -565,6 +565,11 @@ def _parse_connect_dsn_and_args(
565
565
else :
566
566
instance_name , dsn = dsn , None
567
567
568
+ # The cloud profile is potentially relevant to resolving credentials at
569
+ # any stage, including the config stage when other environment variables
570
+ # are not yet read.
571
+ cloud_profile = os .getenv ('EDGEDB_CLOUD_PROFILE' )
572
+
568
573
has_compound_options = _resolve_config_options (
569
574
resolved_config ,
570
575
'Cannot have more than one of the following connection options: '
@@ -621,6 +626,11 @@ def _parse_connect_dsn_and_args(
621
626
(wait_until_available , '"wait_until_available" option' )
622
627
if wait_until_available is not None else None
623
628
),
629
+ cloud_profile = (
630
+ (cloud_profile ,
631
+ '"EDGEDB_CLOUD_PROFILE" environment variable' )
632
+ if cloud_profile is not None else None
633
+ ),
624
634
)
625
635
626
636
if has_compound_options is False :
@@ -647,7 +657,6 @@ def _parse_connect_dsn_and_args(
647
657
env_tls_ca_file = os .getenv ('EDGEDB_TLS_CA_FILE' )
648
658
env_tls_security = os .getenv ('EDGEDB_CLIENT_TLS_SECURITY' )
649
659
env_wait_until_available = os .getenv ('EDGEDB_WAIT_UNTIL_AVAILABLE' )
650
- cloud_profile = os .getenv ('EDGEDB_CLOUD_PROFILE' )
651
660
652
661
has_compound_options = _resolve_config_options (
653
662
resolved_config ,
@@ -714,11 +723,6 @@ def _parse_connect_dsn_and_args(
714
723
'"EDGEDB_WAIT_UNTIL_AVAILABLE" environment variable'
715
724
) if env_wait_until_available is not None else None
716
725
),
717
- cloud_profile = (
718
- (cloud_profile ,
719
- '"EDGEDB_CLOUD_PROFILE" environment variable' )
720
- if cloud_profile is not None else None
721
- ),
722
726
)
723
727
724
728
if not has_compound_options :
0 commit comments