Skip to content

Commit

Permalink
Fix OCI import issue (#4178)
Browse files Browse the repository at this point in the history
* Fix OCI import issue

* Update sky/clouds/oci.py

Co-authored-by: Zhanghao Wu <zhanghao.wu@outlook.com>

* edit comments

---------

Co-authored-by: Zhanghao Wu <zhanghao.wu@outlook.com>
  • Loading branch information
yika-luo and Michaelvll authored Oct 25, 2024
1 parent ee708e7 commit b8a9a57
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sky/clouds/oci.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,11 @@ def get_credential_file_mounts(self) -> Dict[str, str]:
api_key_file = oci_cfg[
'key_file'] if 'key_file' in oci_cfg else 'BadConf'
sky_cfg_file = oci_utils.oci_config.get_sky_user_config_file()
except (ImportError, oci_adaptor.oci.exceptions.ConfigFileNotFound):
# Must catch ImportError before any oci_adaptor.oci.exceptions
# because oci_adaptor.oci.exceptions can throw ImportError.
except ImportError:
return {}
except oci_adaptor.oci.exceptions.ConfigFileNotFound:
return {}

# OCI config and API key file are mandatory
Expand Down

0 comments on commit b8a9a57

Please sign in to comment.