| Index: command_wrapper/command_wrapper_web.py
|
| ===================================================================
|
| --- command_wrapper/command_wrapper_web.py (revision 54349)
|
| +++ command_wrapper/command_wrapper_web.py (working copy)
|
| @@ -28,6 +28,7 @@
|
| uname_version = db.StringProperty()
|
| uname_machine = db.StringProperty()
|
| uname_processor = db.StringProperty()
|
| + response = db.StringProperty()
|
|
|
|
|
| class LogHandler(webapp.RequestHandler):
|
| @@ -51,7 +52,16 @@
|
| ci.uname_version = str(self.request.get('uname_version'))
|
| ci.uname_machine = str(self.request.get('uname_machine'))
|
| ci.uname_processor = str(self.request.get('uname_processor'))
|
| + ci.response = '0'
|
| + # Don't retry cat for _index.html
|
| + if (ci.command.find('_index.html') >= 0 and
|
| + ci.command.find('gsutil cat gs://') >= 0 and
|
| + ci.returncode == 1):
|
| + ci.response = '1'
|
| + # Store it.
|
| ci.put()
|
| + # Emit response.
|
| + self.response.out.write(ci.response)
|
|
|
|
|
| class ViewerHandler(webapp.RequestHandler):
|
| @@ -68,8 +78,14 @@
|
| # Only allow @google.com folks to look.
|
| if not user.email().endswith('@google.com'):
|
| return
|
| - items = db.GqlQuery('SELECT * FROM CommandInvocation '
|
| - 'ORDER BY timestamp DESC LIMIT 100')
|
| + uname_nodename = self.request.get('uname_nodename')
|
| + if uname_nodename:
|
| + items = db.GqlQuery('SELECT * FROM CommandInvocation '
|
| + 'WHERE uname_nodename = :1 '
|
| + 'ORDER BY timestamp DESC LIMIT 100', uname_nodename)
|
| + else:
|
| + items = db.GqlQuery('SELECT * FROM CommandInvocation '
|
| + 'ORDER BY timestamp DESC LIMIT 100')
|
| template_values = {
|
| 'items': items,
|
| }
|
|
|