コード例 #1
0
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__
コード例 #2
0
    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)
コード例 #3
0
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__
コード例 #4
0
ファイル: couchbase_return.py プロジェクト: DavideyLee/salt
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__
コード例 #5
0
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__
コード例 #6
0
ファイル: sdk_client.py プロジェクト: prasanna135/testrunner
 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)
コード例 #7
0
 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)
コード例 #8
0
ファイル: cbasync.py プロジェクト: yamingd/Roo
#!/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