My personal preference would be for get_maxram() to return None instead of -1. This test would then be

    if max_ram is not None:
or simply

    if max_ram: