def __virtual__(): if not HAS_DEPS: return False, "Could not import couchbase returner; couchbase is not installed." couchbase.set_json_converters(_json_dumps, salt.utils.json.loads) return __virtualname__
def __init__(self, bucket, hosts=["localhost"], scheme="couchbase", ssl_path=None, uhm_options=None, username=None, password=None, quiet=True, certpath=None, transcoder=None, ipv6=False, compression=True): self.certpath = TestInputSingleton.input.param("certpath", certpath) if not username: self.username = TestInputSingleton.input.param( "rest_username", "Administrator") else: self.username = username if not password: self.password = TestInputSingleton.input.param( "rest_password", "password") else: self.password = password self.connection_string = \ self._createString(scheme=scheme, bucket=bucket, hosts=hosts, certpath=self.certpath, uhm_options=uhm_options, ipv6=ipv6, compression=compression) self.bucket = bucket self.quiet = quiet self.transcoder = transcoder self.default_timeout = 1 self._createConn() couchbase.set_json_converters(json.dumps, json.loads)
def __virtual__(): if not HAS_DEPS: return False # try to load some faster json libraries. In order of fastest to slowest json = salt.utils.import_json() couchbase.set_json_converters(json.dumps, json.loads) return __virtualname__
def __virtual__(): if not HAS_DEPS: return False, 'Could not import couchbase returner; couchbase is not installed.' # try to load some faster json libraries. In order of fastest to slowest json = salt.utils.json.import_json() couchbase.set_json_converters(json.dumps, json.loads) return __virtualname__
def __init__(self, bucket, hosts = ["localhost"] , scheme = "couchbase", ssl_path = None, uhm_options = None, password=None, quiet=True, certpath = None, transcoder = None): self.connection_string = \ self._createString(scheme = scheme, bucket = bucket, hosts = hosts, certpath = certpath, uhm_options = uhm_options) self.password = password self.quiet = quiet self.transcoder = transcoder self.default_timeout = 0 self._createConn() couchbase.set_json_converters(json.dumps, json.loads)
def __init__(self, bucket, hosts = ["localhost"] , scheme = "couchbase", ssl_path = None, uhm_options = None, password=None, quiet=True, certpath = None, transcoder = None, ipv6=False, compression=True): self.connection_string = \ self._createString(scheme = scheme, bucket = bucket, hosts = hosts, certpath = certpath, uhm_options = uhm_options, ipv6=ipv6, compression=compression) self.bucket = bucket self.password = password self.quiet = quiet self.transcoder = transcoder self.default_timeout = 1 self._createConn() couchbase.set_json_converters(json.dumps, json.loads)
#!/usr/bin/env python # -*- coding: utf-8 -*- # -*- coding: utf-8 -*- import roo.log logger = roo.log.logger(__name__) import os from datetime import datetime import couchbase from roo.lib import jsonfy couchbase.set_json_converters(jsonfy.dumps, jsonfy.loads) import tornado.web """ import tornado.platform.twisted tornado.platform.twisted.install() from twisted.internet import reactor """ from twisted.python.failure import Failure from twisted.internet.defer import inlineCallbacks, Deferred # for 1.2.0 from couchbase import experimental experimental.enable() from txcouchbase.connection import Connection as TxCouchbase from roo.plugin import BasePlugin, plugin from roo.model import EntityModel from roo.collections import RowSet