Пример #1
0
def _make_request_payload(slave_id, reservation_payload):
    return {
        'slaveId': slave_id.encode('UTF-8'),
        # We used to_bytes here since py2 json doesn't have a well defined
        # return type.  When moving to python 3, replace with .encode()
        'resources': to_bytes(json.dumps(reservation_payload)).replace(b'+', b'%20'),
    }
Пример #2
0
def _make_request_payload(slave_id, reservation_payload):
    return {
        "slaveId": slave_id.encode("UTF-8"),
        # We used to_bytes here since py2 json doesn't have a well defined
        # return type.  When moving to python 3, replace with .encode()
        "resources": to_bytes(json.dumps(reservation_payload)).replace(b"+", b"%20"),
    }