Merge ~brad-figg/+git/kteam-tools:cranky-config-environment-variable into ~canonical-kernel/+git/kteam-tools:master

Proposed by Brad Figg
Status: Needs review
Proposed branch: ~brad-figg/+git/kteam-tools:cranky-config-environment-variable
Merge into: ~canonical-kernel/+git/kteam-tools:master
Diff against target: 12 lines (+2/-0)
1 file modified
cranky/crl/config.py (+2/-0)
Reviewer Review Type Date Requested Status
Cory Todd (community) Needs Fixing
Canonical Kernel Pending
Review via email: mp+434742@code.launchpad.net

Description of the change

This is a one line change and I think the commit message says it all.

To post a comment you must log in.
Revision history for this message
Cory Todd (corytodd) wrote :

This causes a runtime error if the CRANKY_CONFIG_FILE env is not set. By default this key will not exist so we should use something like this to say "use the env if set otherwise use whatever filename was provided".

filename = os.getenv("CRANKY_CONFIG_FILE", filename)

review: Needs Fixing

Unmerged commits

6480a2b... by Brad Figg

crl/config.py: enable the option of getting the path to the cranky configuration file from an environment variable

Signed-off-by: Brad Figg <email address hidden>

Succeeded
[SUCCEEDED] ktl:0 (build)
[SUCCEEDED] ktl:1 (build)
[SUCCEEDED] ktl:2 (build)
[SUCCEEDED] ktl:0 (build)
[SUCCEEDED] ktl:1 (build)
[SUCCEEDED] ktl:2 (build)
[SUCCEEDED] ktl:0 (build)
[SUCCEEDED] ktl:1 (build)
[SUCCEEDED] ktl:2 (build)
19 of 9 results

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/cranky/crl/config.py b/cranky/crl/config.py
2index c927f31..9f4d612 100755
3--- a/cranky/crl/config.py
4+++ b/cranky/crl/config.py
5@@ -9,6 +9,8 @@ class Config:
6 def __init__(self, filename=None, data=None):
7 self.config = None
8
9+ filename = os.environ['CRANKY_CONFIG_FILE']
10+
11 if filename is not None and data is not None:
12 raise ValueError("supply only one of filename and data")
13

Subscribers

People subscribed via source and target branches