'Update the account server(s) with latest container info.
:param req: swob.Request object
:param account: account name
:param container: container name
:param broker: container DB broker object
:returns: if all the account requests return a 404 error code,
HTTPNotFound response object,
if the account cannot be updated due to a malformed header,
an HTTPBadRequest response object,
otherwise None.'

def account_update(self, req, account, container, broker):

    account_hosts = [h.strip() for h in req.headers.get('X-Account-Host', '').split(',')]
    account_devices = [d.strip() for d in req.headers.get('X-Account-Device', '').split(',')]
    account_partition = req.headers.get('X-Account-Partition', '')
    if (len(account_hosts) != len(account_devices)):
        self.logger.error((_('ERROR    Account    update    failed:    different        numbers    of    hosts    and    devices    in    request:    "%(hosts)s"    vs    "%(devices)s"') % {'hosts': req.headers.get('X-Account-Host', ''), 'devices': req.headers.get('X-Account-Device', '')}))
        return HTTPBadRequest(req=req)
    if account_partition:
        updates = list(zip(account_hosts, account_devices))
    else:
        updates = []
    account_404s = 0
    for (account_host, account_device) in updates:
        (account_ip, account_port) = account_host.rsplit(':', 1)
        new_path = ('/' + '/'.join([account, container]))
        info = broker.get_info()
        account_headers = HeaderKeyDict({'x-put-timestamp': info['put_timestamp'], 'x-delete-timestamp': info['delete_timestamp'], 'x-object-count': info['object_count'], 'x-bytes-used': info['bytes_used'], 'x-trans-id': req.headers.get('x-trans-id', '-'), 'X-Backend-Storage-Policy-Index': info['storage_policy_index'], 'user-agent': ('container-server    %s' % os.getpid()), 'referer': req.as_referer()})
        if (req.headers.get('x-account-override-deleted', 'no').lower() == 'yes'):
            account_headers['x-account-override-deleted'] = 'yes'
        try:
            with ConnectionTimeout(self.conn_timeout):
                conn = http_connect(account_ip, account_port, account_device, account_partition, 'PUT', new_path, account_headers)
            with Timeout(self.node_timeout):
                account_response = conn.getresponse()
                account_response.read()
                if (account_response.status == HTTP_NOT_FOUND):
                    account_404s += 1
                elif (not is_success(account_response.status)):
                    self.logger.error(_('ERROR    Account    update    failed    with    %(ip)s:%(port)s/%(device)s    (will    retry    later):    Response    %(status)s    %(reason)s'), {'ip': account_ip, 'port': account_port, 'device': account_device, 'status': account_response.status, 'reason': account_response.reason})
        except (Exception, Timeout):
            self.logger.exception(_('ERROR    account    update    failed    with    %(ip)s:%(port)s/%(device)s    (will    retry    later)'), {'ip': account_ip, 'port': account_port, 'device': account_device})
    if (updates and (account_404s == len(updates))):
        return HTTPNotFound(req=req)
    else:
        return None
