summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEnric Balletbo i Serra <enric.balletbo@collabora.com>2015-03-09 17:29:16 (GMT)
committerEnric Balletbo i Serra <enric.balletbo@collabora.com>2015-03-11 12:29:01 (GMT)
commitb9f671c87056c097e62df050d20f2ed7839cf3f2 (patch)
tree5404c45665e8c45dd1b9491954c2a61b41169273
parent898e7cdfb583be0aabfd20c38d961c46174f4621 (diff)
downloadlqa-b9f671c87056c097e62df050d20f2ed7839cf3f2.tar.gz
lqa-b9f671c87056c097e62df050d20f2ed7839cf3f2.tar.xz
Do not require the profile file for some commands.
Some commands like cancel-job, fetch-result and resubmit-job do not require a profile file, so unmark the profile-file as a required argument and do the code modifications to be able to use these commands without this parameter. Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
-rw-r--r--lqa_tool/__init__.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/lqa_tool/__init__.py b/lqa_tool/__init__.py
index 0104b9c..2635f9a 100644
--- a/lqa_tool/__init__.py
+++ b/lqa_tool/__init__.py
@@ -102,7 +102,7 @@ class Cli(object):
parser.add_argument('--print-json', action='store_true',
help="print the json job to stdout")
parser.add_argument('-g', '--profile-file', metavar='PROFILE.yaml',
- help="set profile file", required=True)
+ help="set profile file")
parser.add_argument('-p', '--profile', nargs='+', type=str,
help="specify the profiles to use")
parser.add_argument('--all-profiles', action='store_true',
@@ -132,7 +132,8 @@ class Lava(object):
def __init__(self, args):
self.args = args
self.settings = Settings(self, LAVA_CONFIG)
- self.profiles = Profiles(self, self.args.profile_file)
+ if self.args.profile_file:
+ self.profiles = Profiles(self, self.args.profile_file)
self.server = self.open_connection()
def open_connection(self):
@@ -151,8 +152,9 @@ class Lava(object):
2) All profiles from 'all-profiles'
3) Or run without any profile....
"""
- # Fetch the main profile and merge later with any sub profile
- main_profile = self.profiles.config.get('main-profile', {})
+ if self.args.profile_file:
+ # Fetch the main profile and merge later with any sub profile
+ main_profile = self.profiles.config.get('main-profile', {})
if self.args.profile or self.args.all_profiles:
for profile in self.profiles.config.get('profiles', []):