diff --git a/esds/helpers/platform.py b/esds/helpers/platform.py index bafd493..7d16756 100644 --- a/esds/helpers/platform.py +++ b/esds/helpers/platform.py @@ -98,11 +98,10 @@ class YAMLPlatformFile: self.parsing_error("Invalid interface type \""+interfaces[i]["type"]+"\"") is_wired=interfaces[i]["type"] == "wired" links=list() - if type(interfaces[i]["links"]) == list: - for link in interfaces[i]["links"]: - links.append(self.parse_link(link)) - else: - links.append(self.parse_link(interfaces[i]["links"])) + if type(interfaces[i]["links"]) != list: + self.parsing_error("Invalide type of links in interface "+i) + for link in interfaces[i]["links"]: + links.append(self.parse_link(link)) ##### Create network matrix BW=np.full((node_count,node_count),0) LAT=np.full((node_count,node_count),0) diff --git a/example/platform.yaml b/example/platform.yaml index 0545c04..0f6134e 100644 --- a/example/platform.yaml +++ b/example/platform.yaml @@ -18,4 +18,5 @@ interfaces: - all 1Bps 10s eth0: type: "wired" - links: all 5Mbps 10s all \ No newline at end of file + links: + - all 5Mbps 10s all \ No newline at end of file