예제 #1
0
    def is_object_on_target(self, target, key):
        # get key ready for getPrevious on target
        hashpath, _nounce = split_key(key)
        key = object_key(hashpath)

        conn = self.get_conn(target)
        with conn:
            entry = conn.getPrevious(key).wait()
        return entry and entry.key.startswith(key[:-1])
예제 #2
0
    def is_object_on_target(self, target, key):
        # get key ready for getPrevious on target
        policy_index, hashpath, _nounce = split_key(key)
        key = object_key(policy_index, hashpath)

        conn = self.get_conn(target)
        with conn:
            entry = conn.getPrevious(key).wait()
        return entry and entry.key.startswith(key[:-1])
예제 #3
0
    def is_object_on_target(self, target, key):
        # get key ready for getPrevious on target
        key_info = split_key(key)
        key = object_key(key_info['policy_index'], key_info['hashpath'])

        conn = self.get_conn(target)
        entry = conn.getPrevious(key).wait()
        target_key_info = split_key
        if not entry:
            return False
        target_key_info = split_key(entry.key)
        if target_key_info['hashpath'] != key_info['hashpath']:
            return False
        if target_key_info['timestamp'] < key_info['timestamp']:
            return False
        return True
예제 #4
0
    def is_object_on_target(self, target, key):
        # get key ready for getPrevious on target
        key_info = split_key(key)
        key = object_key(key_info['policy'], key_info['hashpath'])

        conn = self.get_conn(target['device'])
        entry = conn.getPrevious(key).wait()
        if not entry:
            return False
        target_key_info = split_key(entry.key)
        if not target_key_info:
            return False
        if target_key_info['hashpath'] != key_info['hashpath']:
            return False
        if target_key_info['timestamp'] < key_info['timestamp']:
            return False
        if (target_key_info['frag_index'] is not None and
                target_key_info['frag_index'] != target.get('index')):
            return False
        return True