def ex_drives_list(self): """ Return a list of all the available drives. """ response = self.connection.request(action = '/drives/info', method = 'GET') result = str2dicts(response.body) return result
def ex_static_ip_create(self): """ Create a new static IP address. """ response = self.connection.request(action = '/resources/ip/create', method = 'GET') result = str2dicts(response.body) return result
def _get_node_info(self, node): response = self.connection.request(action = '/servers/%s/info' % (node.id)) result = str2dicts(response.body) return result[0]
def parse_body(self): if not self.body: return self.body return str2dicts(self.body)
def test_str2dicts(self): string = 'mem 1024\ncpu 2200\n\nmem2048\cpu 1100' result = str2dicts(string) self.assertEqual(len(result), 2)