diff --git a/alibabacloud_credentials/provider/cli_profile.py b/alibabacloud_credentials/provider/cli_profile.py index f996d3c..2ad5bad 100644 --- a/alibabacloud_credentials/provider/cli_profile.py +++ b/alibabacloud_credentials/provider/cli_profile.py @@ -29,7 +29,7 @@ class CLIProfileCredentialsProvider(ICredentialsProvider): def __init__(self, *, profile_name: str = None): - self._profile_file = os.path.join(ac.HOME, "/.aliyun/config.json") + self._profile_file = os.path.join(ac.HOME, ".aliyun/config.json") self._profile_name = profile_name or au.environment_profile_name self.__innerProvider = None diff --git a/alibabacloud_credentials/provider/profile.py b/alibabacloud_credentials/provider/profile.py index 86f43e2..67e2fa0 100644 --- a/alibabacloud_credentials/provider/profile.py +++ b/alibabacloud_credentials/provider/profile.py @@ -46,7 +46,7 @@ def _load_ini(file_path: str) -> Dict[str, Dict[str, str]]: def _get_default_file() -> str: - return os.path.join(ac.HOME, "/.alibabacloud/credentials.ini") + return os.path.join(ac.HOME, ".alibabacloud/credentials.ini") class ProfileCredentialsProvider(ICredentialsProvider): diff --git a/tests/provider/test_cli_profile.py b/tests/provider/test_cli_profile.py index 5e4091f..7cd44b2 100644 --- a/tests/provider/test_cli_profile.py +++ b/tests/provider/test_cli_profile.py @@ -22,7 +22,7 @@ class TestCLIProfileCredentialsProvider(unittest.TestCase): def setUp(self): self.profile_name = "test_profile" - self.profile_file = os.path.join(ac.HOME, "/.aliyun/config.json") + self.profile_file = os.path.join(ac.HOME, ".aliyun/config.json") self.config = { "current": "test_profile", "profiles": [ @@ -95,7 +95,7 @@ def test_init_valid_input(self): provider = CLIProfileCredentialsProvider() self.assertEqual(provider._profile_name, self.profile_name) - self.assertEqual(provider._profile_file, os.path.join(ac.HOME, "/.aliyun/config.json")) + self.assertEqual(provider._profile_file, os.path.join(ac.HOME, ".aliyun/config.json")) def test_get_credentials_valid_ak(self): """ diff --git a/tests/provider/test_profile.py b/tests/provider/test_profile.py index d9e9d33..d509385 100644 --- a/tests/provider/test_profile.py +++ b/tests/provider/test_profile.py @@ -14,7 +14,7 @@ class TestProfileCredentialsProvider(unittest.TestCase): def setUp(self): self.profile_name = "default" - self.profile_file = os.path.join(ac.HOME, "/.alibabacloud/credentials.ini") + self.profile_file = os.path.join(ac.HOME, ".alibabacloud/credentials.ini") self.config = {'default': { 'type': 'access_key', 'access_key_id': 'test_access_key_id',