Changeset 488
- Timestamp:
- 05/27/08 09:39:52
(8 months ago)
- Author:
- mgoldman
- Message:
Added agent log pushing.
Subtracted server log pulling.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r487 |
r488 |
|
| 107 | 107 | log file we have come. Don't send all messages at every startup. |
|---|
| 108 | 108 | ''' |
|---|
| 109 | | print "Unimplemented" |
|---|
| 110 | | return None |
|---|
| | 109 | msgs = self.log.newmsgs() |
|---|
| | 110 | if msgs == []: |
|---|
| | 111 | return None |
|---|
| | 112 | return protocol.Message("log", "update", msgs) |
|---|
| 111 | 113 | |
|---|
| 112 | 114 | def updated_modules(self): |
|---|
| r486 |
r488 |
|
| 363 | 363 | return [self.service_manager(m) for m in self.manager.accept_and_wait(timeout)] |
|---|
| 364 | 364 | |
|---|
| 365 | | def updatelogs(self): |
|---|
| 366 | | ''' Updates server side logs for all known clients. ''' |
|---|
| 367 | | msg = protocol.Message() |
|---|
| 368 | | msg.msg = "log" |
|---|
| 369 | | msg.type = "query" |
|---|
| 370 | | msg.body = "UPDATE" |
|---|
| 371 | | # Call the comm function to send the messages and collect the results |
|---|
| 372 | | # first function just returns the message, pass in the message and |
|---|
| 373 | | # None for the manager and info since we aren't going to use it. |
|---|
| 374 | | res = self.comm(lambda *x: msg, msg, (None, None)) |
|---|
| 375 | | s = storage.Layer(storage_root) |
|---|
| 376 | | [s.append_log_messages(id, lst) for ((clientsock,lst), id) in res] |
|---|
| 377 | | s.update() |
|---|
| 378 | | |
|---|
| 379 | 365 | def query(self, ip, item, queryl): |
|---|
| 380 | 366 | if queryl == []: |
|---|
| … | … | |
| 401 | 387 | if __name__ == "__main__": |
|---|
| 402 | 388 | m = Master() |
|---|
| 403 | | cntr = 0 |
|---|
| 404 | 389 | while True: |
|---|
| 405 | 390 | print "sheep" |
|---|
| 406 | 391 | m.run2(5) |
|---|
| 407 | | if(cntr % 12 == 0): |
|---|
| 408 | | m.updatelogs() |
|---|
| 409 | | cntr += 1 |
|---|
Download in other formats:
* Generating other formats may take time.