def reconfigureQueue(capacityProperties, yarnSiteProperty, mod_conf_path): ''' Reconfigures queue. If a key is present in two properties dicts, capacityProperties value takes precedence. ''' for key1 in yarnSiteProperty: if key1 not in capacityProperties: capacityProperties[key1] = yarnSiteProperty[key1] else: for key2 in yarnSiteProperty[key1]: if key2 not in capacityProperties[key1]: capacityProperties[key1][key2] = yarnSiteProperty[key1][ key2] #capacityProperties.update(yarnSiteProperty) Hadoop.modifyConfig(capacityProperties, {'services': ['all']}, makeCurrConfBackupInWindows=False) MAPRED.restartJobtracker(mod_conf_path)