'Register the current system to the provided RHSM or Sat6 server
Raises:
* Exception - if error occurs while running command'

def register(self, username, password, autosubscribe, activationkey, org_id, consumer_type, consumer_name, consumer_id, force_register, environment):

    args = ['subscription-manager', 'register']
    if activationkey:
        args.extend(['--activationkey', activationkey])
        if org_id:
            args.extend(['--org', org_id])
    else:
        if autosubscribe:
            args.append('--autosubscribe')
        if username:
            args.extend(['--username', username])
        if password:
            args.extend(['--password', password])
        if consumer_type:
            args.extend(['--type', consumer_type])
        if consumer_name:
            args.extend(['--name', consumer_name])
        if consumer_id:
            args.extend(['--consumerid', consumer_id])
        if force_register:
            args.extend(['--force'])
        if environment:
            args.extend(['--environment', environment])
    (rc, stderr, stdout) = self.module.run_command(args, check_rc=True)
