for resource, scope in [('ram', 'total'), ('ram', 'single'),
('disk', 'total'), ('disk', 'single'),
('vms', 'total'), ('vms', 'active')]:
val = getattr(opts, resource+scope)
if val is not None:
for resource, scope in [('ram', 'total'), ('ram', 'single'),
('disk', 'total'), ('disk', 'single'),
('vms', 'total'), ('vms', 'active')]:
val = getattr(opts, resource+scope)
if val is not None: