summaryrefslogtreecommitdiffstats
path: root/src/lib/Component.py
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2008-01-16 18:40:37 +0000
committerNarayan Desai <desai@mcs.anl.gov>2008-01-16 18:40:37 +0000
commitf168f665d6bcb15aab44521656eba220687f335d (patch)
tree88c74bea950c0895b9ecd27efe2e1d82901bd5ee /src/lib/Component.py
parentbc6d34c9d2af19dfae84a4327eb5c6e338826457 (diff)
downloadbcfg2-f168f665d6bcb15aab44521656eba220687f335d.tar.gz
bcfg2-f168f665d6bcb15aab44521656eba220687f335d.tar.bz2
bcfg2-f168f665d6bcb15aab44521656eba220687f335d.zip
Remove proxy use from Component
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4249 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Component.py')
-rw-r--r--src/lib/Component.py27
1 files changed, 2 insertions, 25 deletions
diff --git a/src/lib/Component.py b/src/lib/Component.py
index c1f87dbe7..f2edf5d09 100644
--- a/src/lib/Component.py
+++ b/src/lib/Component.py
@@ -1,13 +1,12 @@
'''Cobalt component base classes'''
__revision__ = '$Revision$'
-import atexit, logging, select, signal, socket, sys, time, urlparse, xmlrpclib, cPickle, ConfigParser, os
+import logging, select, signal, socket, sys, urlparse, xmlrpclib, cPickle, os
from base64 import decodestring
import BaseHTTPServer, SimpleXMLRPCServer
import Bcfg2.tlslite.errors
import Bcfg2.tlslite.api
-import Bcfg2.Client.Proxy as Proxy
from Bcfg2.tlslite.TLSConnection import TLSConnection
log = logging.getLogger('Component')
@@ -133,7 +132,7 @@ class Component(TLSServer,
__name__ = 'Component'
__implementation__ = 'Generic'
__statefields__ = []
- async_funcs = ['assert_location']
+ async_funcs = []
fork_funcs = []
child_limit = 32
@@ -171,8 +170,6 @@ class Component(TLSServer,
self.logger.info("Bound to port %s" % self.port)
self.funcs.update({'system.listMethods':self.addr_system_listMethods})
self.atime = 0
- self.assert_location()
- atexit.register(self.deassert_location)
def _cobalt_marshalled_dispatch(self, data, address, authenticated=False):
"""Decode and dispatch XMLRPC requests. Overloaded to pass through
@@ -296,26 +293,6 @@ class Component(TLSServer,
if self.socket in rsockinfo:
return self.socket.accept()
- def assert_location(self):
- '''Assert component location with slp'''
- if self.__name__ == 'service-location' or self.static:
- return
- if (time.time() - self.atime) > 240:
- slp = Proxy.service_location()
- slp.AssertService({'tag':'location', 'name':self.__name__, 'url':self.url})
- self.atime = time.time()
-
- def deassert_location(self):
- '''remove registration from slp'''
- if self.__name__ == 'service-location' or self.static:
- return
- slp = Proxy.service_location()
- try:
- slp.DeassertService([{'tag':'location', 'name':self.__name__, 'url':self.url}])
- except xmlrpclib.Fault, fault:
- if fault.faultCode == 11:
- self.logger.error("Failed to deregister self; no matching component")
-
def serve_forever(self):
"""Handle one request at a time until doomsday."""
while not self.shut: