def upsert(self, row, keys, ensure=None, types={}):
        # check whether keys arg is a string and format as a list
        if not isinstance(keys, (list, tuple)):
            keys = [keys]
        self._check_dropped()

        ensure = self.database.ensure_schema if ensure is None else ensure
        if ensure:
            self.create_index(keys)

        filters = {}
        for key in keys:
            filters[key] = row.get(key)

        res = self.find_one(**filters)
        if res is not None:
            row_count = self.update(row, keys, ensure=ensure, types=types)
            if row_count == 0:
                return False
            elif row_count == 1:
                try:
                    return res['id']
                except KeyError:
                    return True
            else:
                return True
        else:
            return self.insert(row, ensure=ensure, types=types)
Get the netmask of the master node for this cluster.
dataset/ETHPy150Open pudo/dataset/dataset/persistence/table.py/Table.upsert--crossover with--dataset/ETHPy150Open ganeti/ganeti/lib/config/__init__.py/ConfigWriter.GetMasterNetmask