#!/usr/bin/env python3

import sys
import yaml

def update_mac_address(hostname, new_mac, file_path):
    with open(file_path, 'r') as f:
        data = yaml.safe_load(f)

    for host in data['hosts']:
        if host['name'] == hostname:
            host['bootMACAddress'] = new_mac
            break

    with open(file_path, 'w') as f:
        yaml.dump(data, f, default_flow_style=False)

if __name__ == "__main__":
    hostname = sys.argv[1]
    new_mac = sys.argv[2]
    file_path = sys.argv[3]
    update_mac_address(hostname, new_mac, file_path)