~fo0bar/turku/turku-agent-encoding

« back to all changes in this revision

Viewing changes to turku_agent/ping.py

  • Committer: Ryan Finnie
  • Date: 2015-03-27 00:12:39 UTC
  • Revision ID: ryan.finnie@canonical.com-20150327001239-vfr0zngssydcvo27
Restructure API data structures

Show diffs side-by-side

added added

removed removed

Lines of Context:
107
107
        api_reply = api_call(config['api_url'], 'agent_ping_restore', api_out)
108
108
 
109
109
        sources_by_storage = {}
110
 
        for source_name in api_reply['sources']:
111
 
            source = api_reply['sources'][source_name]
 
110
        for source_name in api_reply['machine']['sources']:
 
111
            source = api_reply['machine']['sources'][source_name]
112
112
            if source_name not in config['sources']:
113
113
                continue
114
114
            if 'storage' not in source:
162
162
        if 'scheduled_sources' not in api_reply:
163
163
            return
164
164
        sources_by_storage = {}
165
 
        for source_name in api_reply['scheduled_sources']:
166
 
            source = api_reply['scheduled_sources'][source_name]
 
165
        for source_name in api_reply['machine']['scheduled_sources']:
 
166
            source = api_reply['machine']['scheduled_sources'][source_name]
167
167
            if source_name not in config['sources']:
168
168
                continue
169
169
            if 'storage' not in source: