+ # Filter out ovs relevant information if --ovs option passed
+ # else collect all information
+ filters = set()
+ if only_ovs_info:
+ filters.add('ovs')
+ ovs_info_caps = [CAP_NETWORK_STATUS, CAP_SYSTEM_LOGS,
+ CAP_NETWORK_CONFIG]
+ ovs_info_list = ['process-tree']
+ # We cannot use iteritems, since we modify 'data' as we pass through
+ for (k, v) in data.items():
+ cap = v['cap']
+ if 'filename' in v:
+ info = k[0]
+ else:
+ info = k
+ if info not in ovs_info_list and cap not in ovs_info_caps:
+ del data[k]
+
+ if filters:
+ filter = ",".join(filters)
+ else:
+ filter = None
+