

def _create_role(self, role_name, role_arn, role_policy):
    'Method to create a role for a given role name and arn\n        if it does not exist\n        '
    role_result = None
    role_policy_result = None
    if self._check_if_role_exists(role_name):
        LOG.debug((('Role ' + role_name) + ' exists.'))
    else:
        LOG.debug(((('Role ' + role_name) + ' does not exist. Creating default role for EC2: ') + role_name))
        role_result = self._create_role_with_role_policy(role_name, role_policy, role_arn)
        role_policy_result = self._get_role_policy(role_arn)
    return (role_result, role_policy_result)

dataset/ETHPy150Open aws/aws-cli/awscli/customizations/datapipeline/createdefaultroles.py CreateDefaultRoles._create_role/original