def auth_system(self, system_id): """ System authentication. We override the standard function because we need to check additionally if this system_id is entitled for proxy functionality. """ log_debug(3) server = rhnHandler.auth_system(self, system_id) # if it did not blow up, we have a valid server. Check proxy # entitlement. # XXX: this needs to be moved out of the rhnServer module, # possibly in here h = rhnSQL.prepare(""" select 1 from rhnProxyInfo pi where pi.server_id = :server_id """) h.execute(server_id=self.server_id) row = h.fetchone_dict() if not row: # we require entitlement for this functionality log_error("Server not entitled for Proxy", self.server_id) raise rhnFault( 1002, _('Spacewalk Proxy service not enabled for server profile: "%s"' ) % server.server["name"]) # we're fine... return server
def auth_system(self, system_id): """ System authentication. We override the standard function because we need to check additionally if this system_id is entitled for proxy functionality. """ log_debug(3) server = rhnHandler.auth_system(self, system_id) # if it did not blow up, we have a valid server. Check proxy # entitlement. # XXX: this needs to be moved out of the rhnServer module, # possibly in here h = rhnSQL.prepare(""" select 1 from rhnProxyInfo pi where pi.server_id = :server_id """) h.execute(server_id = self.server_id) row = h.fetchone_dict() if not row: # we require entitlement for this functionality log_error("Server not entitled for Proxy", self.server_id) raise rhnFault(1002, _( 'Spacewalk Proxy service not enabled for server profile: "%s"') % server.server["name"]) # we're fine... return server
def auth_system(self, systemid): rhnHandler.auth_system(self, systemid) self.org_id = self.server.server['org_id']
def auth_system(self, action, system_id): # Stuff the action in the headers: transport = rhnFlags.get('outputTransportOptions') transport['X-RHN-Action'] = action return rhnHandler.auth_system(self, system_id)