yanger: Allow manufactering date to be day 1-9

When the day of month is 1-9 the format did not match the
yang model
This commit is contained in:
Mattias Walström
2024-04-06 13:00:13 +02:00
committed by Joachim Wiberg
parent c72bc34df1
commit 320410b950
+1 -1
View File
@@ -160,7 +160,7 @@ def get_vpd_data(vpd):
if vpd.get("data"):
component["class"] = "infix-hardware:vpd"
if vpd["data"].get("manufacture-date"):
component["mfg-date"]=datetime.strptime(vpd["data"]["manufacture-date"],"%m/%d/%Y %H:%M:%S").strftime("%Y-%m-%-dT%H:%M:%SZ")
component["mfg-date"]=datetime.strptime(vpd["data"]["manufacture-date"],"%m/%d/%Y %H:%M:%S").strftime("%Y-%m-%dT%H:%M:%SZ")
if vpd["data"].get("manufacter"):
component["mfg-name"]=vpd["data"]["manufacturer"]
if vpd["data"].get("product-name"):