Exemplo n.º 1
0
def clone(conf, source, *args, **opts):
    dest = args[0] if len(args) > 0 else None

    hook(conf, dest, "pre-clone", source=source)
    clone_app.clone(source, dest, rev=opts.get('rev'))
    hook(conf, dest, "post-clone", source=source)
    return 0
Exemplo n.º 2
0
def test_invalid_source():
    '''
    Test case for clone(invalid_source)

    If a source uri do not contain ``_design/``, it's invalid.
    '''
    clone('http://foo.bar')
Exemplo n.º 3
0
def clone(conf, source, *args, **opts):
    dest = args[0] if len(args) > 0 else None

    hook(conf, dest, "pre-clone", source=source)
    clone_app.clone(source, dest, rev=opts.get('rev'))
    hook(conf, dest, "post-clone", source=source)
    return 0
Exemplo n.º 4
0
def test_invalid_source():
    '''
    Test case for clone(invalid_source)

    If a source uri do not contain ``_design/``, it's invalid.
    '''
    clone('http://foo.bar')
Exemplo n.º 5
0
    def fetch(self, url, path, *args, **opts):
        if url.startswith("couchdb://"):
            url = url.replace("couchdb://", "http://")
        else:
            url = url.replace("couchdbs://", "https://")

        try:
            dburl, docid = url.split('_design/')
        except ValueError:
            raise VendorError("%s isn't a valid source" % url)
        dest = os.path.join(path, docid)
        clone(url, dest=dest)
        rcfile = os.path.join(dest, ".couchapprc")
        try:
            os.unlink(rcfile)
        except:
            pass
Exemplo n.º 6
0
    def fetch(self, url, path, *args, **opts):
        if url.startswith("couchdb://"):
            url = url.replace("couchdb://", "http://")
        else:
            url = url.replace("couchdbs://", "https://")

        try:
            dburl, docid = url.split("_design/")
        except ValueError:
            raise VendorError("%s isn't a valid source" % url)
        dest = os.path.join(path, docid)
        clone(url, dest=dest)
        rcfile = os.path.join(dest, ".couchapprc")
        try:
            os.unlink(rcfile)
        except:
            pass