Skip to content

Commit

Permalink
fallback to env var
Browse files Browse the repository at this point in the history
Signed-off-by: Sylvain Hellegouarch <sh@defuze.org>
  • Loading branch information
Lawouach committed Jul 11, 2023
1 parent b3fef1e commit 7db9a93
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@

## [Unreleased][]

[Unreleased]: https://github.com/chaostoolkit-incubator/chaostoolkit-azure/compare/0.15.2...HEAD
[Unreleased]: https://github.com/chaostoolkit-incubator/chaostoolkit-azure/compare/0.15.3...HEAD

## [0.15.3][] - 2023-07-11

[0.15.3]: https://github.com/chaostoolkit-incubator/chaostoolkit-azure/compare/0.15.2...0.15.3

### Changed

* Default to at least loading from env variables

## [0.15.2][] - 2023-07-11

Expand Down
2 changes: 1 addition & 1 deletion chaosazure/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"init_website_management_client", "init_resource_graph_client", "init_netapp_management_client",
"init_storage_management_client"
]
__version__ = '0.15.2'
__version__ = '0.15.3'


def discover(discover_system: bool = True) -> Discovery:
Expand Down
10 changes: 7 additions & 3 deletions chaosazure/common/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,13 @@ def load_secrets(experiment_secrets: Secrets):
'access_token': None,
}

# no secretes
logger.warn("Unable to load Azure credentials.")
return {}
return {
'client_id': os.getenv("AZURE_CLIENT_ID"),
'client_secret': os.getenv("AZURE_CLIENT_SECRET"),
'tenant_id': os.getenv("AZURE_TENANT_ID"),
'cloud': cloud.get_or_raise(os.getenv("AZURE_CLOUD")),
'access_token': os.getenv("AZURE_ACCESS_TOKEN"),
}


def load_configuration(experiment_configuration: Configuration):
Expand Down

0 comments on commit 7db9a93

Please sign in to comment.