Ejemplo n.º 1
0
 def _get_io_buffers(self, settings):
     specific_buffers = settings.specific_io_buffers.all()
     if len(specific_buffers) == 0:
         specific_buffers = [hs for hs in \
             ss.Host.objects.filter(role__name='io buffer', active=True)]
     hf = HostFactory()
     return [hf.create_host(hs) for hs in specific_buffers]
Ejemplo n.º 2
0
    def _get_archives(self, settings):
        '''
        Return a list of G2Host instances that are the archives for this file.

        The G2Host list is created from the specificArchives attribute. If
        there are no specificArchives defined, then all the hosts that have
        the 'archive' role and are 'active' will be used.
        '''

        specific_archives = settings.specificArchives.all()
        if len(specific_archives) == 0:
            specific_archives = [hs for hs in \
                ss.Host.objects.filter(role__name='archive', active=True)]
        hf = HostFactory(logger=self.logger)
        return [hf.create_host(hs) for hs in specific_archives]