(self)
return monitored_services
Return filtered service objects list
Return filtered service objects list
Return filtered service objects list
def monitor_filter(self):
        """Return filtered service objects list"""
        services = self.client.services.list(filters={'label': 'com.ouroboros.enable'})

        monitored_services = []

        for service in services:
            ouro_label = service.attrs['Spec']['Labels'].get('com.ouroboros.enable')
            if not self.config.label_enable or ouro_label.lower() in ["true", "yes"]:
                monitored_services.append(service)

        self.data_manager.monitored_containers[self.socket] = len(monitored_services)
        self.data_manager.set(self.socket)

        return monitored_services
def monitor_filter ( self ) : services = self . client . services . list ( filters = { 'label' : 'com.ouroboros.enable' } ) monitored_services = [ ] for service in services : ouro_label = service . attrs [ 'Spec' ] [ 'Labels' ] . get ( 'com.ouroboros.enable' ) if not self . config . label_enable or ouro_label . lower ( ) in [ "true" , "yes" ] : monitored_services . append ( service ) self . data_manager . monitored_containers [ self . socket ] = len ( monitored_services ) self . data_manager . set ( self . socket ) return monitored_services