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

def register(self, username, password, autosubscribe, activationkey):

    args = ['subscription-manager', 'register']
    if activationkey:
        args.append(('--activationkey    "%s"' % activationkey))
    else:
        if autosubscribe:
            args.append('--autosubscribe')
        if username:
            args.extend(['--username', username])
        if password:
            args.extend(['--password', password])
    (rc, stderr, stdout) = self.module.run_command(args, check_rc=True)
