'Return the host def for the host'

def extractHostDef(self, host):

    hostKey = host['hostKey']
    hostDef = None
    hostDefLast = None
    if (hostKey not in self.serverHostDefs):
        hostDef = {}
        hostDef['hostname'] = host['hostname']
        hostDef['id'] = host['id']
        hostDef['hostKey'] = host['hostKey']
        hostDef['port'] = host['port']
    else:
        hostDefLast = {}
        hostDef = self.serverHostDefs[hostKey]
        hostDefLast['ssl'] = hostDef['ssl']
        hostDefLast['profiler'] = hostDef['profiler']
        hostDefLast['getLogs'] = hostDef['getLogs']
        hostDefLast['mongoUri'] = hostDef['mongoUri']
    mongoUri = host['uri']
    if ((getattr(self.settings, 'globalAuthUsername', None) is not None) and (getattr(self.settings, 'globalAuthPassword', None) is not None)):
        credentials = ('%(username)s:%(password)s' % {'username': urllib.quote_plus(self.settings.globalAuthUsername), 'password': urllib.quote_plus(self.settings.globalAuthPassword)})
        if (not ('@' in mongoUri)):
            mongoUri = re.sub('(^mongodb://)(.+)', (('mongodb://' + credentials) + '@\\2'), mongoUri)
        else:
            mongoUri = re.sub('(^mongodb://.+:.+@)(.+)', (('mongodb://' + credentials) + '@\\2'), mongoUri)
    hostDef['mongoUri'] = mongoUri
    hostDef['munin'] = host['munin']
    hostDef['profiler'] = host['profiler']
    if ('sslEnabled' not in host):
        hostDef['ssl'] = False
    else:
        hostDef['ssl'] = host['sslEnabled']
    if ('getLogs' not in host):
        hostDef['getLogs'] = False
    else:
        hostDef['getLogs'] = host['getLogs']
    return (hostDef, hostDefLast)
