def get_vm_spec(): lab_spec = dict2default(lab_specz) vm_spec = { "lab_ID" : lab_spec['lab']['description']['id'], "os" : lab_spec['lab']['runtime_requirements']['platform']['os'], "os_version" : lab_spec['lab']['runtime_requirements']['platform']['osVersion'], "ram" : lab_spec['lab']['runtime_requirements']['platform']['memory']['min_required'], "diskspace" : lab_spec['lab']['runtime_requirements']['platform']['storage']['min_required'], "swap" : lab_spec['lab']['runtime_requirements']['platform']['memory']['swap'] } return vm_spec
def _get_vm_spec(self, lab_spec): """ Parse out VM related requirements from a given lab_spec """ lab_spec = dict2default(lab_spec) runtime_reqs = lab_spec['lab']['runtime_requirements'] vm_spec = { "lab_ID": lab_spec['lab']['description']['id'], "os": runtime_reqs['platform']['os'], "os_version": runtime_reqs['platform']['osVersion'], "ram": runtime_reqs['platform']['memory']['min_required'], "diskspace": runtime_reqs['platform']['storage']['min_required'], "swap": runtime_reqs['platform']['memory']['swap'] } return vm_spec
def get_vm_spec(): lab_spec = dict2default(lab_specz) vm_spec = { "lab_ID": lab_spec['lab']['description']['id'], "os": lab_spec['lab']['runtime_requirements']['platform']['os'], "os_version": lab_spec['lab']['runtime_requirements'] ['platform']['osVersion'], "ram": lab_spec['lab']['runtime_requirements']['platform'] ['memory']['min_required'], "diskspace": lab_spec['lab']['runtime_requirements'] ['platform']['storage']['min_required'], "swap": lab_spec['lab']['runtime_requirements']['platform'] ['memory']['swap'] } return vm_spec