Question 19
This commit is contained in:
@@ -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