def getJsonObject(urlstr):
url=baseURL +urlstr
base64string = base64.encodestring('%s:%s' % (username, password)).replace('\n', '')
request = urllib2.Request(url)
request.add_header("Authorization", "Basic %s" % base64string)
result = urllib2.urlopen(request)
data = result.read()
# print data
jsonObject= json.loads(data)
# results=jsonObject['results']
return jsonObject
ralph runserver
and make run
make run
run runserver with debug enabled - that what probably makes a difference here
Line number: 1 - "Column 'id' not found in dataset. Available columns are: ['hostname;barcode']"
OrderedDict([('hostname;barcode', 'xxx;xxx')])
Traceback (most recent call last):
File "/opt/ralph/ralph-core/lib/python3.4/site-packages/import_export/fields.py", line 57, in clean
value = data[self.column_name]
KeyError: 'id'
During handling of the above exception, another exception occurred:
api/memory/?limit=10&offset=0&base_object=6
"count": 1,
"next": null,
"previous": null,
"results": [
{
"id": 1,
"url": "https://ralph.my.domain/api/memory/1/",
"ui_url": "https://ralph.my.domain/assets/memory/1/",
"created": "2016-10-05T18:40:58.994684",
"modified": "2016-10-05T18:40:58.994707",
"model_name": "vmem",
"size": 2048,
"speed": null,
"base_object": {
"id": 6,
"url": "https://ralph.my.domain/api/base-objects/6/",
"tags": [],
"created": "2016-09-14T17:57:03.729526",
"modified": "2016-10-05T18:40:58.991509",
"remarks": "",
"parent": "https://ralph.my.domain/api/base-objects/2/",
"service_env": "https://ralph.my.domain/api/services-environments/3/",
"configuration_path": null
}
}
]