예제 #1
0
    def __init__(self, dns_driver=None, dns_instance_entry_factory=None, *args, **kwargs):
        if not dns_driver:
            dns_driver = CONF.dns_driver
        dns_driver = utils.import_object(dns_driver)
        self.driver = dns_driver()

        if not dns_instance_entry_factory:
            dns_instance_entry_factory = CONF.dns_instance_entry_factory
        entry_factory = utils.import_object(dns_instance_entry_factory)
        self.entry_factory = entry_factory()
예제 #2
0
    def __init__(self, dns_driver=None, dns_instance_entry_factory=None,
                 *args, **kwargs):
        if not dns_driver:
            dns_driver = config.Config.get("dns_driver",
                          "reddwarf.dns.driver.DnsDriver")
        dns_driver = utils.import_object(dns_driver)
        self.driver = dns_driver()

        if not dns_instance_entry_factory:
            dns_instance_entry_factory = config.Config.get(
                          'dns_instance_entry_factory',
                          'reddwarf.dns.driver.DnsInstanceEntryFactory')
        entry_factory = utils.import_object(dns_instance_entry_factory)
        self.entry_factory = entry_factory()
예제 #3
0
    def __init__(self,
                 dns_driver=None,
                 dns_instance_entry_factory=None,
                 *args,
                 **kwargs):
        if not dns_driver:
            dns_driver = CONF.dns_driver
        dns_driver = utils.import_object(dns_driver)
        self.driver = dns_driver()

        if not dns_instance_entry_factory:
            dns_instance_entry_factory = CONF.dns_instance_entry_factory
        entry_factory = utils.import_object(dns_instance_entry_factory)
        self.entry_factory = entry_factory()
예제 #4
0
    def __init__(self, dns_driver=None, dns_instance_entry_factory=None,
                 *args, **kwargs):
        if not dns_driver:
            dns_driver = config.Config.get(
                "dns_driver",
                "reddwarf.dns.driver.DnsDriver")
        dns_driver = utils.import_object(dns_driver)
        self.driver = dns_driver()

        if not dns_instance_entry_factory:
            dns_instance_entry_factory = config.Config.get(
                'dns_instance_entry_factory',
                'reddwarf.dns.driver.DnsInstanceEntryFactory')
        entry_factory = utils.import_object(dns_instance_entry_factory)
        self.entry_factory = entry_factory()
예제 #5
0
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.

import optparse

from reddwarf.common import utils
from reddwarf.common import config


db_api = utils.import_object(
    config.Config.get("db_api_implementation",
                      "reddwarf.db.sqlalchemy.api"))


class Query(object):
    """Mimics sqlalchemy query object.

    This class allows us to store query conditions and use them with
    bulk updates and deletes just like sqlalchemy query object.
    Using this class makes the models independent of sqlalchemy

    """
    def __init__(self, model, query_func, **conditions):
        self._query_func = query_func
        self._model = model
        self._conditions = conditions
예제 #6
0
def mysql_connection():
    cls = CONFIG.get('mysql_connection',
                     "local.MySqlConnection")
    if cls == "local.MySqlConnection":
        return MySqlConnection()
    return import_object(cls)()
예제 #7
0
파일: usage.py 프로젝트: riddhi89/reddwarf
def create_usage_verifier():
    return utils.import_object(CONFIG.usage_endpoint)
예제 #8
0
def mysql_connection():
    cls = CONFIG.get('mysql_connection', "local.MySqlConnection")
    if cls == "local.MySqlConnection":
        return MySqlConnection()
    return import_object(cls)()
예제 #9
0
def _get_impl():
    """Delay import of rpc_backend until FLAGS are loaded."""
    global _RPCIMPL
    if _RPCIMPL is None:
        _RPCIMPL = utils.import_object(rpc_backend_opt)
    return _RPCIMPL
예제 #10
0
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.

import optparse

from reddwarf.common import utils
from reddwarf.common import config


db_api = utils.import_object(config.Config.get("db_api_implementation", "reddwarf.db.sqlalchemy.api"))


class Query(object):
    """Mimics sqlalchemy query object.

    This class allows us to store query conditions and use them with
    bulk updates and deletes just like sqlalchemy query object.
    Using this class makes the models independent of sqlalchemy

    """

    def __init__(self, model, query_func, **conditions):
        self._query_func = query_func
        self._model = model
        self._conditions = conditions
예제 #11
0
파일: usage.py 프로젝트: DJohnstone/trove
def create_usage_verifier():
    return utils.import_object(CONFIG.usage_endpoint)