'Sends a NMJ update command to the specified machine
host: The hostname/IP to send the request to (no port)
database: The database to send the request to
mount: The mount URL to use (optional)
Returns: True if the request succeeded, False otherwise'

def _sendNMJ(self, host, database, mount=None):

    if mount:
        try:
            req = urllib.request.Request(mount)
            logger.log(u'Try    to    mount    network    drive    via    url:    {0}'.format(mount), logger.DEBUG)
            handle = urllib.request.urlopen(req)
        except IOError as e:
            if hasattr(e, u'reason'):
                logger.log(u'NMJ:    Could    not    contact    Popcorn    Hour    on    host    {0}:    {1}'.format(host, e.reason), logger.WARNING)
            elif hasattr(e, u'code'):
                logger.log(u'NMJ:    Problem    with    Popcorn    Hour    on    host    {0}:    {1}'.format(host, e.code), logger.WARNING)
            return False
        except Exception as e:
            logger.log((u'NMJ:    Unknown    exception:    ' + ex(e)), logger.ERROR)
            return False
    UPDATE_URL = u'http://%(host)s:8008/metadata_database?%(params)s'
    params = {u'arg0': u'scanner_start', u'arg1': database, u'arg2': u'background', u'arg3': u''}
    params = urllib.parse.urlencode(params)
    updateUrl = (UPDATE_URL % {u'host': host, u'params': params})
    try:
        req = urllib.request.Request(updateUrl)
        logger.log(u'Sending    NMJ    scan    update    command    via    url:    {0}'.format(updateUrl), logger.DEBUG)
        handle = urllib.request.urlopen(req)
        response = handle.read()
    except IOError as e:
        if hasattr(e, u'reason'):
            logger.log(u'NMJ:    Could    not    contact    Popcorn    Hour    on    host    {0}:    {1}'.format(host, e.reason), logger.WARNING)
        elif hasattr(e, u'code'):
            logger.log(u'NMJ:    Problem    with    Popcorn    Hour    on    host    {0}:    {1}'.format(host, e.code), logger.WARNING)
        return False
    except Exception as e:
        logger.log((u'NMJ:    Unknown    exception:    ' + ex(e)), logger.ERROR)
        return False
    try:
        et = etree.fromstring(response)
        result = et.findtext(u'returnValue')
    except SyntaxError as e:
        logger.log(u'Unable    to    parse    XML    returned    from    the    Popcorn    Hour:    {0}'.format(e), logger.ERROR)
        return False
    if (int(result) > 0):
        logger.log(u'Popcorn    Hour    returned    an    error    code:    {0}'.format(result), logger.ERROR)
        return False
    else:
        logger.log(u'NMJ    started    background    scan', logger.INFO)
        return True
