def addAddon(self, args):
        """
            Adds the given addon to the deployment.
        """
        app_name, deployment_name = self.parse_app_deployment_name(args.name)
        if not deployment_name:
            deployment_name = 'default'
        if not args.addon:
            raise InputErrorException('NoAddonGiven')

        options = None
        if args.options:
            options = parse_additional_addon_options(args.options)

        try:
            self.api.create_addon(app_name, deployment_name, args.addon, options)
        except ConflictDuplicateError:
            raise InputErrorException('DuplicateAddon')
        except BadRequestError as e:
            if 'This is not a valid addon name' in str(e):
                raise InputErrorException('InvalidAddon')
            raise
        except ForbiddenError:
            raise InputErrorException('ForbiddenAddon')

        return True
dataset/ETHPy150Open cloudControl/cctrl/cctrl/app.py/AppController.addAddon/original