def _select_mgmt_networks(self, conf):
nets = conf['<STR_LIT>']<EOL>mgmts = sorted(<EOL>[<EOL>name for name, net in nets.items()<EOL>if net.get('<STR_LIT>') is True<EOL>]<EOL>)<EOL>if len(mgmts) == <NUM_LIT:0>:<EOL><INDENT>mgmt_name = sorted((list(nets.keys())))[<NUM_LIT:0>]<EOL>LOGGER.debug(<EOL>'<STR_LIT>',<EOL>mgmt_name<EOL>)<EOL>nets[mgmt_name]['<STR_LIT>'] = True<EOL>mgmts.append(mgmt_name)<EOL><DEDENT>for mgmt_name in mgmts:<EOL><INDENT>if nets[mgmt_name].get('<STR_LIT>', None) is None:<EOL><INDENT>nets[mgmt_name]['<STR_LIT>'] = '<STR_LIT>'<EOL><DEDENT><DEDENT>return mgmts<EOL>
Select management networks. If no management network is found, it will
mark the first network found by sorted the network lists. Also adding
default DNS domain, if none is set.

Args:
    conf(spec): spec