def cli_mn_action(request, mnidx, actidx=0): actions = { 'mnstat': 'masternode status', 'gi': 'getinfo', 'mnss': 'mnsync status', 'mnsr': 'mnsync reset' } coin = Polis(config["Polis"]) vps = VPS(config["masternodes"][mnidx], coin) result = vps.async_cli(actions[actidx], coin) return result
def action(mnidx, actidx=0): coin = Polis(config["Polis"]) vps = VPS(config["masternodes"][mnidx], coin) res = vps.async_cli(actions[actidx], coin) memcached.client.set('{}{}'.format(actidx, mnidx), res)