def get_options_rspec(omnispec, filter_allocated):
    # Convert it to XML
    root = ET.Element('rspec')
    root.set('xmlns', "http://protogeni.net/resources/rspec/0.2")
    
        
    for id, r in omnispec.get_resources().items():
        if filter_allocated and not r.get_allocate():
            continue
        res_type = r.get_type()
        if res_type == 'RandomPC':
            for i in range(0, r['options']['number']):
                node = ET.SubElement(root, 'node', virtual_id=i%'geni%s', virtualization_type='emulab_vnode',
                              startup_command=r['options']['startup command'] )
                if r['options']['os'] != '':
                    ET.SubElement(node, 'disk_image', name='urn:publicid:IDN+emulab.net+image+emulab-ops//%s' % r['options']['os'])
                
        else:
            raise(Exception('Unknown resource type ' + res_type))

    return ET.tostring(root)
dataset/ETHPy150Open fp7-ofelia/ocf/expedient/src/python/omnilib/omnispec/rspec_pg.py/get_options_rspec/swapped operands of `%`