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()
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()
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()
# 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
def mysql_connection(): cls = CONFIG.get('mysql_connection', "local.MySqlConnection") if cls == "local.MySqlConnection": return MySqlConnection() return import_object(cls)()
def create_usage_verifier(): return utils.import_object(CONFIG.usage_endpoint)
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
# # 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