def addUser(self, args):
        """
            Add a user specified by the e-mail address to an application or deployment.
        """
        app_name, deployment_name = self.parse_app_deployment_name(args.name)

        if self.settings.prefix_project_name:
            if len(args.email.split(':')) != 2:
                prefix = self.api.read_users()[0]['email'].split(':')[0]
                args.email = '{0}:{1}'.format(prefix, args.email)

        try:
            if deployment_name:
                self.api.create_deployment_user(app_name, deployment_name, args.email, args.role)

            else:
                self.api.create_app_user(app_name, args.email, args.role)

        except ConflictDuplicateError:
            raise InputErrorException('UserBelongsToApp')
        except NotImplementedError:
            raise InputErrorException('CommandNotImplemented')
        return True
dataset/ETHPy150Open cloudControl/cctrl/cctrl/app.py/AppController.addUser/original