Question 19
This commit is contained in:
@@ -47,7 +47,6 @@ def create_vlan_config_cpe_paris():
|
||||
R3_data = load_json_data_from_file(file_path='data/vlan_R03.json')
|
||||
R3_config = render_network_config(template_name='vlan_router.j2', data=R3_data)
|
||||
return R3_config,esw3_config
|
||||
pass
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -96,7 +96,17 @@ def question_18(net_connect):
|
||||
print(save_output)
|
||||
|
||||
def get_inventory():
|
||||
pass
|
||||
"""
|
||||
Lit le fichier inventory/hosts.json et retourne son contenu.
|
||||
"""
|
||||
inventory_file = "inventory/hosts.json"
|
||||
try:
|
||||
with open(inventory_file, "r") as f:
|
||||
data = json.load(f)
|
||||
return data
|
||||
except FileNotFoundError:
|
||||
print(f"Erreur : le fichier {inventory_file} n'existe pas.")
|
||||
return []
|
||||
|
||||
|
||||
def question_20():
|
||||
@@ -124,9 +134,9 @@ if __name__ == "__main__":
|
||||
#question_15(net_connect)
|
||||
#question_16(net_connect)
|
||||
#question_17(net_connect)
|
||||
question_18(net_connect)
|
||||
# hosts = get_inventory()
|
||||
# print(hosts)
|
||||
#question_20()
|
||||
#question_18(net_connect)
|
||||
hosts = get_inventory()
|
||||
"print(hosts)
|
||||
question_20()
|
||||
#question_21()
|
||||
net_connect.disconnect()
|
||||
Reference in New Issue
Block a user