def rollback_cmd(self, args):

        try:
            app_name, deployment_name = self.parse_app_deployment_name(args.name)
        except ParseAppDeploymentName:
            raise InputErrorException('InvalidApplicationName')

        if not deployment_name:
            deployment_name = 'default'

        logEntries = []

        try:
            logEntries = self.api.read_log(
                app_name,
                deployment_name,
                'deploy',
                last_time=None)
        except GoneError:
            raise InputErrorException('WrongApplication')

        deployments = [e['message'].split(':')[1].strip() for e in logEntries
                       if 'Deployed version' in e['message']]

        try:
            current_deployment = deployments.pop()
        except IndexError:
            raise InputErrorException('NoPreviousVersionFound')

        previous_deployment = None

        while not previous_deployment:
            try:
                deployment_version = deployments.pop()
                if deployment_version != current_deployment:
                    previous_deployment = deployment_version
            except IndexError:
                raise InputErrorException('NoPreviousVersionFound')

        try:
            self.api.update_deployment(
                app_name,
                version=previous_deployment,
                deployment_name=deployment_name)
        except GoneError:
            raise InputErrorException('WrongApplication')
        except ForbiddenError:
            raise InputErrorException('NotAllowed')
Method to create a role for a given role name and arn
dataset/ETHPy150Open cloudControl/cctrl/cctrl/app.py/AppController.rollback_cmd--crossover with--dataset/ETHPy150Open aws/aws-cli/awscli/customizations/datapipeline/createdefaultroles.py/CreateDefaultRoles._create_role