diff --git a/blueprints/cloud-operations/network-dashboard/src/main.py b/blueprints/cloud-operations/network-dashboard/src/main.py index bd57f18e..ec5e5c6e 100755 --- a/blueprints/cloud-operations/network-dashboard/src/main.py +++ b/blueprints/cloud-operations/network-dashboard/src/main.py @@ -266,11 +266,13 @@ def main_cf_pubsub(event, context): help='Load JSON resources from file, skips init and discovery.') @click.option('--debug-plugin', help='Run only core and specified timeseries plugin.') +@click.option('--debug', is_flag=True, default=False, + help='Turn on debug logging.') def main(discovery_root, monitoring_project, project=None, folder=None, custom_quota_file=None, dump_file=None, load_file=None, - debug_plugin=None): + debug_plugin=None, debug=False): 'CLI entry point.' - logging.basicConfig(level=logging.INFO) + logging.basicConfig(level=logging.INFO if not debug else logging.DEBUG) if discovery_root.partition('/')[0] not in ('folders', 'organizations'): raise SystemExit('Invalid discovery root.') descriptors = [] diff --git a/blueprints/cloud-operations/network-dashboard/src/plugins/discover-cai.py b/blueprints/cloud-operations/network-dashboard/src/plugins/discover-cai.py index 1ac62d06..16d2c5b8 100644 --- a/blueprints/cloud-operations/network-dashboard/src/plugins/discover-cai.py +++ b/blueprints/cloud-operations/network-dashboard/src/plugins/discover-cai.py @@ -98,7 +98,7 @@ def _handle_resource(resources, asset_type, data): # derive parent type and id and skip if parent is not within scope parent_data = _get_parent(data['parent'], resources) if not parent_data: - LOGGER.info(f'{resource["self_link"]} outside perimeter') + LOGGER.debug(f'{resource["self_link"]} outside perimeter') LOGGER.debug([ resources['organization'], resources['folders'], resources['projects:number'] diff --git a/blueprints/cloud-operations/network-dashboard/src/plugins/discover-compute-quota.py b/blueprints/cloud-operations/network-dashboard/src/plugins/discover-compute-quota.py index 9c9e8f94..9801803a 100644 --- a/blueprints/cloud-operations/network-dashboard/src/plugins/discover-compute-quota.py +++ b/blueprints/cloud-operations/network-dashboard/src/plugins/discover-compute-quota.py @@ -45,6 +45,7 @@ def _handle_discovery(resources, response): self_link = part.get('selfLink') if not self_link: logging.warn('invalid quota response') + continue self_link = self_link.split('/') if kind == 'compute#project': project_id = self_link[-1]