oneconf does not sync: "Invalid Package data from Server"

Bug #1311486 reported by m
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oneconf (Ubuntu)
New
Undecided
Unassigned

Bug Description

On my machine (Ubuntu 12.04 with enablement stack) I could trace the error

oneconf.networksync:Invalid package data from server

This comes from:

/usr/lib/python2.7/dist-packages/oneconf/networksync

starting in line 89

    def list_packages(self, machine_uuid):
        """List all packages for that machine"""
        package_list = self._get('packages/%s/' % machine_uuid, scheme=AUTHENTICATED_API_SCHEME)
        if not package_list:
            raise APIError('Package list empty')
        # FIXME: need to do this hack to transform the http request to a json format content
        try:
            package_list = json.loads(package_list[1:-1].replace("'", '"').replace("True", "true").replace("False", 'false'))
        except ValueError, e:
            raise APIError('Package list invalid: %s' % e)
        return package_list

The #FIXME is not enough, because the server delivers a kind of unicode string.
json.loads(package_list[1:-1].replace("u'", "'").replace("'", '"').replace("True", "true").replace("False", 'false')

does it for me

the updated file is added, but its not a proper patch

Revision history for this message
m (dummfikk) wrote :

could not change the commited file

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.