Changeset 503
- Timestamp:
- 05/28/08 14:24:06
(8 months ago)
- Author:
- jmowery
- Message:
added error branch for refused updates
fixed a logic error in agent (local to manager means NOT local to agent)
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r502 |
r503 |
|
| 160 | 160 | for file_name, group, version, local, checksum in file_set: |
|---|
| 161 | 161 | print file_name, group, version, local #XXX debug |
|---|
| 162 | | self.storage.set_file_status(file_name, group, version, local) |
|---|
| | 162 | self.storage.set_file_status(file_name, group, version, not local) |
|---|
| 163 | 163 | if checksum != None: |
|---|
| 164 | 164 | msg.body[file_name] = self.storage.verify_file(file_name, version, checksum) |
|---|
| r502 |
r503 |
|
| 172 | 172 | for (file_name, file_path) in val: |
|---|
| 173 | 173 | if local_layer.is_locked(file_name): |
|---|
| 174 | | #if locked on server (this) side send back current (server) version and deny the update |
|---|
| 175 | | pass |
|---|
| | 174 | #if locked on server (this) side send back current (server) version and deny the update |
|---|
| | 175 | proc = subprocess.Popen(['/usr/bin/md5sum', local_layer.get_current(file)], stdout=subprocess.PIPE) |
|---|
| | 176 | proc.wait() |
|---|
| | 177 | sum = proc.stdout.read().split()[0] |
|---|
| | 178 | body = [(file_name, local_layer.name, storage.get_timestamp(local_layer.get_current(file)), False, sum)] |
|---|
| | 179 | revert_message = protocol.Message('file', 'update', body, ('IP', [clientid])) |
|---|
| | 180 | self.clients.send_key(revert_message, clientid) |
|---|
| 176 | 181 | else: |
|---|
| 177 | 182 | cmd = ['/usr/bin/scp', clientid + ':' + file_path, os.path.join(local_layer.storage.path, file_name)] |
|---|
| … | … | |
| 345 | 350 | proc.wait() |
|---|
| 346 | 351 | sum = proc.stdout.read().split()[0] |
|---|
| 347 | | #CHECKME: make sure this matches what the new agent store expects to receive |
|---|
| 348 | | msg.body.append((storage.get_local_name(file), storage.get_timestamp(file), sum)) |
|---|
| | 352 | file_layer = Layer(storage.get_layer(file)) |
|---|
| | 353 | file_entry = file_layer.get_entry(file) |
|---|
| | 354 | msg.body.append((storage.get_local_name(file), file_layer.name, storage.get_timestamp(file), file_entry.local, sum)) |
|---|
| 349 | 355 | for file_name in remove_list: |
|---|
| 350 | | msg.body.append((file_name, '0', None)) |
|---|
| | 356 | msg.body.append((file_name, '', '0', False, None)) |
|---|
| 351 | 357 | self.clients.send_key(msg, client_id) |
|---|
| 352 | 358 | resp = self.clients.recv_key(client_id)[0][1] |
|---|
Download in other formats:
* Generating other formats may take time.