Ejemplo n.º 1
0
 def copyRecursive(self, inputDrop):
     if isinstance(inputDrop, ContainerDROP):
         for child in inputDrop.children:
             self.copyRecursive(child)
     else:
         for outputDrop in self.outputs:
             with outputDrop:
                 droputils.copyDropContents(inputDrop, outputDrop)
Ejemplo n.º 2
0
    def _replicate(self, drop, store):

        # Dummy, but safe, new UID
        newUid = "uid:" + "".join(
            [random.SystemRandom().choice(string.ascii_letters + string.digits) for _ in xrange(10)]
        )

        if logger.isEnabledFor(logging.DEBUG):
            logger.debug("Creating new DROP %s/%s from %s/%s" % (drop.oid, newUid, drop.oid, drop.uid))

        # For the time being we manually copy the contents of the current DROP into it
        newDrop = store.createDrop(drop.oid, newUid, expectedSize=drop.size, precious=drop.precious)
        droputils.copyDropContents(drop, newDrop)

        if logger.isEnabledFor(logging.DEBUG):
            logger.debug("DROP %s/%s successfully replicated to %s/%s" % (drop.oid, newUid, drop.oid, drop.uid))

        return newDrop, newUid
Ejemplo n.º 3
0
    def _replicate(self, drop, store):

        # Dummy, but safe, new UID
        newUid = 'uid:' + ''.join([
            random.SystemRandom().choice(string.ascii_letters + string.digits)
            for _ in range(10)
        ])

        logger.debug('Creating new DROP with uid %s from %r', newUid, drop)

        # For the time being we manually copy the contents of the current DROP into it
        newDrop = store.createDrop(drop.oid,
                                   newUid,
                                   expectedSize=drop.size,
                                   precious=drop.precious)
        droputils.copyDropContents(drop, newDrop)

        logger.debug('%r successfully replicated to %r', drop, newDrop)

        return newDrop, newUid