All done! GUI + working version. Some few adjustments on the code to be done.
diff --git a/mininet/conf_parser.py b/mininet/conf_parser.py
index 07eb8c9..ae514f3 100644
--- a/mininet/conf_parser.py
+++ b/mininet/conf_parser.py
@@ -30,18 +30,18 @@
hosts = []
- items = config.items('nodes')
+ items = config.items('hosts')
- #makes a first-pass read to nodes section to find empty nodes sections
+ #makes a first-pass read to hosts section to find empty host sections
for item in items:
name = item[0]
rest = item[1].split()
if len(rest) == 0:
- config.set('nodes', name, '_')
+ config.set('hosts', name, '_')
#updates 'items' list
- items = config.items('nodes')
+ items = config.items('hosts')
- #makes a second-pass read to nodes section to properly add hosts
+ #makes a second-pass read to hosts section to properly add hosts
for item in items:
name = item[0]
@@ -90,14 +90,22 @@
uri_list=[]
cpu = None
cores = None
+ cache = None
- for uri in uris:
- if re.match("cpu",uri):
- cpu = float(uri.split('=')[1])
- elif re.match("cores",uri):
- cores = uri.split('=')[1]
- else:
- uri_list.append((uri.split(',')[0],uri.split(',')[1]))
+ if '_' in uris:
+ pass
+ else:
+ for uri in uris:
+ if re.match("cpu",uri):
+ cpu = float(uri.split('=')[1])
+ elif re.match("cores",uri):
+ cores = uri.split('=')[1]
+ elif re.match("cache",uri):
+ cache = uri.split('=')[1]
+ elif re.match("mem",uri):
+ mem = uri.split('=')[1]
+ else:
+ uri_list.append((uri.split(',')[0],uri.split(',')[1]))
routers.append(confCCNHost(name=name , uri_tuples=uri_list, cpu=cpu, cores=cores))
@@ -143,6 +151,3 @@
return links
-
-
-