Merge ~jfguedez/charm-juju-lint:bug/1942945 into charm-juju-lint:master

Proposed by Jose Guedez
Status: Merged
Approved by: James Troup
Approved revision: 62b61dfaa1b7584a1f08b69bd4a653a4c30d9b7f
Merged at revision: d87ae33404e3243047199eee9aa98cacb55ee65d
Proposed branch: ~jfguedez/charm-juju-lint:bug/1942945
Merge into: charm-juju-lint:master
Diff against target: 37 lines (+17/-0)
1 file modified
scripts/auto_lint.py (+17/-0)
Reviewer Review Type Date Requested Status
BootStack Reviewers Pending
BootStack Reviewers Pending
Review via email: mp+408271@code.launchpad.net

Commit message

Adds debug logging to auto_lint.py

To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision d87ae33404e3243047199eee9aa98cacb55ee65d

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/scripts/auto_lint.py b/scripts/auto_lint.py
2index 6446a01..02699f1 100755
3--- a/scripts/auto_lint.py
4+++ b/scripts/auto_lint.py
5@@ -19,8 +19,10 @@ License: Apache License 2.0
6 limitations under the License.
7 """
8
9+import argparse
10 from base64 import b64decode
11 import json
12+import logging
13 from os.path import join
14 import subprocess
15 from sys import exit
16@@ -216,6 +218,21 @@ def lint_juju(auto_lint_config):
17
18 def main():
19 """Call main function."""
20+ parser = argparse.ArgumentParser(
21+ description="Grab juju status/bundle output and analyse it with Juju Lint."
22+ )
23+
24+ parser.add_argument(
25+ "--debug",
26+ action="store_true",
27+ help="Enable debug logging",
28+ )
29+
30+ args = parser.parse_args()
31+
32+ loglevel = logging.DEBUG if args.debug else logging.ERROR
33+ logging.basicConfig(level=loglevel)
34+
35 auto_lint_config = read_json_file(LINT_CONFIG_PATH)
36 verify_auto_lint_config(auto_lint_config)
37 juju_status = loop.run(get_juju_status(auto_lint_config))

Subscribers

People subscribed via source and target branches

to all changes: