def change_hostname(self, db, value, inst=None, host=None):

        if not inst and not host:
            logging.error('You need to specify either instance or hostname')
            return False

        if inst and host:
            logging.error('You cannot specify both inst and hostname')
            return False

        key = 'instance_id'
        if host:
            key = 'hostname'

        param = inst or host
        db.servers.update(
                { key: param},
                {'$set':
                    {'hostname': value}})

        return True
Rotates a list to the right so that the last item appears at the beginning.
dataset/ETHPy150Open urbanairship/aerostat/aerostat/registrar.py/Registrar.change_hostname--crossover with--dataset/ETHPy150Open manahl/PythonTrainingExercises/Beginers/ListsTuples/solutions.py/rotate_right