diff --git a/hbd b/hbd index 66af86d..9c7c6b8 100755 --- a/hbd +++ b/hbd @@ -622,16 +622,25 @@ class HttpHandler(BaseHTTPServer.BaseHTTPRequestHandler): log(uname, ll) elif qr.path == "/u": # update - uname=qa.get('h',[None])[0] + uname=urllib.unquote(qa.get('h',[None])[0]) ucode=qa.get('c', [None])[0] if not ucode or not uname: code, res=self.builderror(400, 'Argument error', "need h= and c= arguments") - elif not Host.hosts.has_key(uname): + elif uname != 'All' and not Host.hosts.has_key(uname): code, res=self.builderror(400, 'Data error', "h=%s not found" % uname) else: - err = updatecode(ucode, urllib.unquote(uname)) res=self.buildhead() - res.append("3 Done: %s" % err if err else "OK") + if uname != 'All': + names = [uname] + else: + names = [] + for n in Host.hosts: + if Host.hosts[n].cver >= 2: # earliest version that supports update + names.append(n) + for n in names: + err = updatecode(ucode, n) + res.append("update started for %s: %s
" % (n, err if err else "OK")) + res.append("Done") elif qr.path == "/api/0/hosts": # api access to host table headerdict = {"Content-Type": "application/json; charset=utf-8" }