+ m.send([const.PIEMAIL % loginbase, const.TECHEMAIL % loginbase])
+ conn.set_nodestate('disable')
+
+ elif sequences[s] == "bad_dns_email":
+ print "...NOTIFYING OWNERS OF DNS FAILURE on %s!!!" % hostname
+ args = {}
+ try:
+ node = api.GetNodes(hostname)[0]
+ net = api.GetNodeNetworks(node['nodenetwork_ids'])[0]
+ except:
+ print traceback.print_exc()
+ # TODO: api error. skip email, b/c all info is not available,
+ # flag_set will not be recorded.
+ return False
+ nodenet_str = network_config_to_str(net)
+
+ args['hostname'] = hostname
+ args['network_config'] = nodenet_str
+ args['nodenetwork_id'] = net['nodenetwork_id']
+ m = PersistMessage(hostname, mailtxt.baddns[0] % args,
+ mailtxt.baddns[1] % args, True, db='baddns_persistmessages')
+
+ loginbase = plc.siteId(hostname)
+ m.send([const.PIEMAIL % loginbase, const.TECHEMAIL % loginbase])