Skip to content

Commit

Permalink
Merge pull request #53 from grycap/devel
Browse files Browse the repository at this point in the history
Fix #52
  • Loading branch information
micafer authored Jan 12, 2023
2 parents d470af2 + 29aa32d commit 2cb2b4b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion radl/radl_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ def val(k, v):
elif isinstance(v, list):
v = list(v)
# disks urls can be a list
if k.startswith("disk") and k.endswith("image.url"):
# also net_interface additional_dns_names
if ((k.startswith("disk") and k.endswith("image.url")) or
(k.startswith("net_interface") and k.endswith("additional_dns_names"))):
return [Feature(k, "=", v)]
else:
return [Feature(k, "contains", p_feature(i)) for i in v]
Expand Down
4 changes: 2 additions & 2 deletions test/TestRADL.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ def test_basic(self):
self.radl_check(r, [1, 1, 1, 1, 0])
s = r.get_system_by_name("curso-aws")
self.assertIsInstance(s, system)
self.assertEqual(len(s.features), 17)
self.assertEqual(len(s.features), 18)
self.assertEqual(s.getValue("disk.0.os.name"), "linux")

radl_json = dump_radl_json(r)
r = parse_radl_json(radl_json)
s = r.get_system_by_name("curso-aws")
self.assertIsInstance(s, system)
self.assertEqual(len(s.features), 17)
self.assertEqual(len(s.features), 18)
self.assertEqual(s.getValue("disk.0.os.name"), "linux")

def test_basic0(self):
Expand Down
1 change: 1 addition & 0 deletions test/test_radl_0.radl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ cpu.count>=1 and
memory.size>=512m and
net_interface.0.connection = 'publica' and
net_interface.0.dns_name = 'cursoaws' and
net_interface.0.additional_dns_names = ['host1@domain.com','host2@domain.com'] and
disks.free_size = 3.92GB and
disk.1.size=1GB and
disk.1.device='hdb' and
Expand Down

0 comments on commit 2cb2b4b

Please sign in to comment.