'Sends the "update" command to the MPD server indicated,
possibly authenticating with a password first.'

def update_mpd(self, host='localhost', port=6600, password=None):

    self._log.info('Updating    MPD    database...')
    try:
        s = BufferedSocket(host, port)
    except socket.error as e:
        self._log.warning(u'MPD    connection    failed:    {0}', six.text_type(e.strerror))
        return
    resp = s.readline()
    if ('OK    MPD' not in resp):
        self._log.warning(u'MPD    connection    failed:    {0!r}', resp)
        return
    if password:
        s.send(('password    "%s"\n' % password.encode('utf8')))
        resp = s.readline()
        if ('OK' not in resp):
            self._log.warning(u'Authentication    failed:    {0!r}', resp)
            s.send('close\n')
            s.close()
            return
    s.send('update\n')
    resp = s.readline()
    if ('updating_db' not in resp):
        self._log.warning(u'Update    failed:    {0!r}', resp)
    s.send('close\n')
    s.close()
    self._log.info(u'Database    updated.')
