+ def profile(self, args):
+ nw_list = list()
+ if args.get("network") is not None:
+ nw_list = self._parse_network(args.get("network"))
+
+ params = self._create_dict(
+ network=nw_list,
+ command=args.get("docker_command"),
+ image=args.get("image"),
+ input=args.get("input"),
+ output=args.get("output"))
+
+ for output in self.c.compute_profile(
+ args.get("datacenter"),
+ args.get("name"),
+ params):
+ print(output + '\n')
+
+ #pp.pprint(r)
+ #print(r)
+
+ def _create_dict(self, **kwargs):
+ return kwargs
+
+ def _parse_network(self, network_str):
+ '''
+ parse the options for all network interfaces of the vnf
+ :param network_str: (id=x,ip=x.x.x.x/x), ...
+ :return: list of dicts [{"id":x,"ip":"x.x.x.x/x"}, ...]
+ '''
+ nw_list = list()
+ networks = network_str[1:-1].split('),(')
+ for nw in networks:
+ nw_dict = dict(tuple(e.split('=')) for e in nw.split(','))
+ nw_list.append(nw_dict)
+
+ return nw_list
+
+