Skip to content

Commit

Permalink
fix inventory bug
Browse files Browse the repository at this point in the history
  • Loading branch information
lixue323 authored and xiaozhu36 committed Dec 13, 2019
1 parent 0c7f86b commit aae2658
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions contrib/inventory/alicloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,19 +161,18 @@ def read_settings(self):
assume_role_params = {}

role_arn = os.environ.get('ALICLOUD_ASSUME_ROLE_ARN', None)
if not role_arn and assume_role is not None:
if not role_arn and assume_role:
assume_role_params['role_arn'] = assume_role.get('role_arn')

session_name = os.environ.get('ALICLOUD_ASSUME_ROLE_SESSION_NAME', None)
if not session_name and assume_role is not None:
if not session_name and assume_role:
assume_role_params['session_name'] = assume_role.get('session_name')

session_expiration = os.environ.get('ALICLOUD_ASSUME_ROLE_SESSION_EXPIRATION', None)
if not session_expiration and assume_role is not None:
if not session_expiration and assume_role:
assume_role_params['session_expiration'] = assume_role.get('session_expiration')

policy = os.environ.get('ALICLOUD_ASSUME_ROLE_POLICY', None)
if not policy and assume_role is not None:
if assume_role:
assume_role_params['policy'] = assume_role.get('policy')

credentials = {
Expand Down

0 comments on commit aae2658

Please sign in to comment.