o edx@sTdZddlZddlZddlZddlmZddlmZdZddgZ GdddeZ dS) znetplan set command lineN)NetplanCommandz70-netplan-set.yamlrendererversioncs,eZdZfddZddZddZZS) NetplanSetcstjdddddS)NsetzTAdd new setting by specifying a dotted key=value pair like ethernets.eth0.dhcp4=trueT) command_id descriptionleaf)super__init__self __class__./usr/share/netplan/netplan/cli/commands/set.pyr !s zNetplanSet.__init__cCsR|jjdtdd|jjdtdd|jjdddd |j|_||dS) N key_valuezNThe nested key=value pair in dotted format. Value can be NULL to delete a key.)typehelpz --origin-hintzCan be used to help choose a name for the overwrite YAML file. A .yaml suffix will be appended automatically.z --root-dir/zAOverwrite configuration files in this root directory instead of /)defaultr)parser add_argumentstr command_setfunc parse_args run_commandr rrrrun&s    zNetplanSet.runc Cs|jdurt|jdkrtd|jrd|jdf}nd}|jdd}t|dkr/td|\}}|d s?dd |f}d d td |D}t }t }t |||| |dtj||||j|dtj||t}|||rt } |dtj| ||dtj| j||d | |j|dtj| |t} | | | ||jn|t|jWddSWddS1swYdS)NrzInvalid/empty origin-hint.yaml=zInvalid value specifiednetworkcSsg|]}|ddqS)z\.r)replace).0srrr Dsz*NetplanSet.command_set..z (?s