'Convenience RPC wrapper'

def api(self, method, *args):

    if ((not hasattr(self, 'server')) or (self.server is None)):
        if (self.hostname != 'rhn.redhat.com'):
            url = ('https://%s/rpc/api' % self.hostname)
        else:
            url = ('https://xmlrpc.%s/rpc/api' % self.hostname)
        self.server = xmlrpclib.Server(url, verbose=0)
        self.session = self.server.auth.login(self.username, self.password)
    func = getattr(self.server, method)
    return func(self.session, *args)
