Current Path : /usr/lib/python2.7/dist-packages/landscape/manager/ |
Current File : //usr/lib/python2.7/dist-packages/landscape/manager/service.pyc |
ó ÍÿŠTc @ s‰ d d l m Z d d l m Z m Z d d l m Z d d l m Z d d l m Z d d l m Z d e f d „ ƒ YZ d „ Z d S( iÿÿÿÿ( t namedClass( t LandscapeServicet run_landscape_service( t ManagerConfiguration( t RemoteBrokerConnector( t ComponentPublisher( t Managert ManagerServicec B s; e Z d Z e j Z d „ Z d „ Z d „ Z d „ Z RS( sm The core Twisted Service which creates and runs all necessary managing components when started. c C s_ t t | ƒ j | ƒ | j ƒ | _ t | j | j ƒ | _ t | j | j | j ƒ | _ d S( N( t superR t __init__t get_pluginst pluginsR t reactort configt managerR t publisher( t selfR ( ( s= /usr/lib/python2.7/dist-packages/landscape/manager/service.pyR s c C s6 g | j j D]% } t d | j ƒ | f ƒ ƒ ^ q S( sA Return instances of all the plugins enabled in the configuration.s landscape.manager.%s.%s( R t plugin_factoriesR t lower( R t plugin_name( ( s= /usr/lib/python2.7/dist-packages/landscape/manager/service.pyR s c sc t t ˆ ƒ j ƒ ˆ j j ƒ ‡ f d † } t ˆ j ˆ j ƒ ˆ _ ˆ j j ƒ } | j | ƒ S( s Start the manager service. This method does 3 things, in this order: - Start listening for connections on the manager socket. - Connect to the broker. - Add all configured plugins, that will in turn register themselves. c sL | ˆ _ | ˆ j _ x! ˆ j D] } ˆ j j | ƒ q Wˆ j j ˆ j ƒ S( N( t brokerR R t addt register_clientt service_name( R t plugin( R ( s= /usr/lib/python2.7/dist-packages/landscape/manager/service.pyt start_plugins+ s ( R R t startServiceR t startR R R t connectort connectt addCallback( R R t connected( ( R s= /usr/lib/python2.7/dist-packages/landscape/manager/service.pyR s c C s1 | j j ƒ | j j ƒ t t | ƒ j ƒ d S( s: Stop the manager and close the connection with the broker.N( R t disconnectR t stopR R t stopService( R ( ( s= /usr/lib/python2.7/dist-packages/landscape/manager/service.pyR"