예제 #1
0
 def __init__(self, backend_name):
     self.backend_name = backend_name
     self.conn = CDMIConnection(
         get_config().get(backend_name, 'cdmi.endpoint'), {
             'user': get_config().get(backend_name, 'credentials.username'),
             'password': get_config().get(backend_name,
                                          'credentials.password')
         })
예제 #2
0
# See the License for the specific language governing permissions and
# limitations under the License.
##
import socket
import time
from uuid import uuid4
import sys
from distutils.version import StrictVersion

import couchdb

from vcdm.config import get_config
from vcdm.errors import InternalError


config = get_config()


class CouchDBStore(object):

    db = None

    def __init__(self):
        server = couchdb.Server(config.get('couchdb', 'datastore.endpoint'))
        # assure version is supported
        try:
            version = server.version()
            assert StrictVersion(version) > '1.0'
        except socket.error as e:
            print "Failed to connect to a CouchDB instance at %s" % config.get('couchdb', 'datastore.endpoint')
            print "[%s] %s" % (e.errno, e.strerror)
예제 #3
0
파일: cdmi.py 프로젝트: limshark/vcdm
 def __init__(self, backend_name):
     self.backend_name = backend_name
     self.conn = CDMIConnection(get_config().get(backend_name, 'cdmi.endpoint'),
                                {'user': get_config().get(backend_name, 'credentials.username'),
                                 'password': get_config().get(backend_name, 'credentials.password')})
예제 #4
0
# You may obtain a copy of the License at
#
# 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.
##
"""
Venus-C Data Management module
"""

from vcdm.config import get_config
conf = get_config()


def c(group, field):
    """Shorthand for getting configuration values"""
    return conf.get(group, field)


# shared environment variables
global env
env = {
    'ds': None,
    'blob': None,
    'mq': None,
    'blobs': {},
    'authn_methods': None
예제 #5
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.
##
from vcdm.config import get_config

try:
    from pyazure.blob import BlobStorage
except ImportError:
    print "Azure blob plugin missing"

import urllib2

config = get_config()


class AzureBlob(object):

    backend_type = 'azure'
    conn = None

    def __init__(self, backend_name):
        self.backend_name = backend_name
        self.cdmi_bucket_name = config.get(backend_name, 'azure.bucket_name')
        self.conn = BlobStorage(config.get(backend_name, 'credentials.blob_url'),
                                 config.get(backend_name, 'credentials.account'),
                                 config.get(backend_name, 'credentials.password'))
        self.conn.create_container(self.cdmi_bucket_name)
예제 #6
0
파일: __init__.py 프로젝트: almaram/vcdm
# You may obtain a copy of the License at
#
# 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.
##
"""
Venus-C Data Management module
"""

from vcdm.config import get_config
conf = get_config()


def c(group, field):
    """Shorthand for getting configuration values"""
    return conf.get(group, field)


# shared environment variables
global env
env = {'ds': None,
       'blob': None,
       'mq': None,
       'blobs': {},
       'authn_methods': None
       }