After reboot of your master, slave and master switched their roles and you want to switch back them:
login to current master and make:
cfg = rs.conf()
cfg.members.priority = 1
cfg.members.priority = 0.5
after «cfg = rs.conf ()» you'll see config, change priority for master (set bigger number) and for slave (set lower number).