Beispiel #1
0
# Copyright 2015 Canonical Ltd.
# This file is part of cloud-init.  See LICENCE file for license information.
#
# vi: ts=4 expandtab

import abc

import six

from cloudinit import logging


LOG = logging.getLogger(__name__)


@six.add_metaclass(abc.ABCMeta)
class BaseSearchStrategy(object):
    """Declare search strategies for data sources

    A *search strategy* represents a decoupled way of choosing
    one or more data sources from a list of data sources.
    Each strategy can be used interchangeably and they can
    be composed. For instance, once can apply a filtering strategy
    over a parallel search strategy, which looks for the available
    data sources.
    """

    @abc.abstractmethod
    def search_data_sources(self, data_sources):
        """Search the possible data sources for this strategy
Beispiel #2
0
# Copyright 2015 Canonical Ltd.
# This file is part of cloud-init.  See LICENCE file for license information.
#
# vi: ts=4 expandtab

import abc

import six

from cloudinit import logging


LOG = logging.getLogger(__name__)


@six.add_metaclass(abc.ABCMeta)
class BaseSearchStrategy(object):
    """Declare search strategies for data sources

    A *search strategy* represents a decoupled way of choosing
    one or more data sources from a list of data sources.
    Each strategy can be used interchangeably and they can
    be composed. For instance, once can apply a filtering strategy
    over a parallel search strategy, which looks for the available
    data sources.
    """

    @abc.abstractmethod
    def search_data_sources(self, data_sources):
        """Search the possible data sources for this strategy