'Switch the is_master stat variable.'

def SetMaster(self, master=True):

    if master:
        logging.info('data    center    is    now    active.')
        stats.STATS.SetGaugeValue('is_master', 1)
        self.is_master = True
    else:
        logging.info('data    center    became    inactive.')
        stats.STATS.SetGaugeValue('is_master', 0)
        self.is_master = False
