def update_operations(old_obj, trans_dict): new_ops = [] for obj in old_obj.db_operations: if obj.vtType == 'delete': new_ops.append(DBDelete.update_version(obj, trans_dict)) elif obj.vtType == 'add': new_op = DBAdd.update_version(obj, trans_dict) new_ops.append(new_op) elif obj.vtType == 'change': new_op = DBChange.update_version(obj, trans_dict) new_ops.append(new_op) return new_ops
def update_operations(old_obj, trans_dict): new_ops = [] for obj in old_obj.db_operations: if obj.vtType == "delete": new_ops.append(DBDelete.update_version(obj, trans_dict)) elif obj.vtType == "add": if obj.db_what == "portSpec": trans_dict["DBAdd"] = {"data": update_portSpec_op} new_op = DBAdd.update_version(obj, trans_dict) new_ops.append(new_op) del trans_dict["DBAdd"] else: new_op = DBAdd.update_version(obj, trans_dict) new_ops.append(new_op) elif obj.vtType == "change": if obj.db_what == "portSpec": trans_dict["DBChange"] = {"data": update_portSpec_op} new_op = DBChange.update_version(obj, trans_dict) new_ops.append(new_op) del trans_dict["DBChange"] else: new_op = DBChange.update_version(obj, trans_dict) new_ops.append(new_op) return new_ops
def update_operations(old_obj, trans_dict): new_ops = [] for obj in old_obj.db_operations: if obj.vtType == 'delete': new_ops.append(DBDelete.update_version(obj, trans_dict)) elif obj.vtType == 'add': if obj.db_what == 'portSpec': trans_dict['DBAdd'] = {'data': update_portSpec_op} new_op = DBAdd.update_version(obj, trans_dict) new_ops.append(new_op) del trans_dict['DBAdd'] else: new_op = DBAdd.update_version(obj, trans_dict) new_ops.append(new_op) elif obj.vtType == 'change': if obj.db_what == 'portSpec': trans_dict['DBChange'] = {'data': update_portSpec_op} new_op = DBChange.update_version(obj, trans_dict) new_ops.append(new_op) del trans_dict['DBChange'] else: new_op = DBChange.update_version(obj, trans_dict) new_ops.append(new_op) return new_ops