When user does not have PerfRepo installed and tries to use LNST PerfRepo commands, user is informed, PerfRepo commands are ignored and test is run without them.
When user does have PerfRepo installed, but does not have url/username/password informations in config file, LNST crashes on PerfRepoRESTAPIException because it tries to connect to URL "".
Desired behaviour would be - inform user, that he does not have needed credentials in config and ignore the commands in the same way they are ignored when the PerfRepo is not installed on the machine.
This patch fixes that. User gets warning logging messages for all of credentials that are missing and that PerfRepo commands will be ignored and test is run without PerfRepo commands.
Signed-off-by: Jiri Prochazka jprochaz@redhat.com --- lnst/Controller/Task.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/lnst/Controller/Task.py b/lnst/Controller/Task.py index 54c9d3f..901d796 100644 --- a/lnst/Controller/Task.py +++ b/lnst/Controller/Task.py @@ -136,7 +136,15 @@ class ControllerAPI(object): username = lnst_config.get_option("perfrepo", "username") if password is None: password = lnst_config.get_option("perfrepo", "password") - self._perf_repo_api.connect(url, username, password) + + if not url: + logging.warn("No PerfRepo URL specified in config file") + if not username: + logging.warn("No PerfRepo username specified in config file") + if not password: + logging.warn("No PerfRepo password specified in config file") + if url and username and password: + self._perf_repo_api.connect(url, username, password)
root = Path(None, self._ctl._recipe_path).get_root() path = Path(root, mapping_file)
Fri, Mar 11, 2016 at 11:20:09AM CET, jprochaz@redhat.com wrote:
When user does not have PerfRepo installed and tries to use LNST PerfRepo commands, user is informed, PerfRepo commands are ignored and test is run without them.
When user does have PerfRepo installed, but does not have url/username/password informations in config file, LNST crashes on PerfRepoRESTAPIException because it tries to connect to URL "".
Desired behaviour would be - inform user, that he does not have needed credentials in config and ignore the commands in the same way they are ignored when the PerfRepo is not installed on the machine.
This patch fixes that. User gets warning logging messages for all of credentials that are missing and that PerfRepo commands will be ignored and test is run without PerfRepo commands.
Signed-off-by: Jiri Prochazka jprochaz@redhat.com
Acked-by: Jan Tluka jtluka@redhat.com
On Fri, Mar 11, 2016 at 11:20:09AM +0100, Jiri Prochazka wrote:
When user does not have PerfRepo installed and tries to use LNST PerfRepo commands, user is informed, PerfRepo commands are ignored and test is run without them.
When user does have PerfRepo installed, but does not have url/username/password informations in config file, LNST crashes on PerfRepoRESTAPIException because it tries to connect to URL "".
Desired behaviour would be - inform user, that he does not have needed credentials in config and ignore the commands in the same way they are ignored when the PerfRepo is not installed on the machine.
This patch fixes that. User gets warning logging messages for all of credentials that are missing and that PerfRepo commands will be ignored and test is run without PerfRepo commands.
Signed-off-by: Jiri Prochazka jprochaz@redhat.com
Acked-by: Ondrej Lichtner olichtne@redhat.com
Fri, Mar 11, 2016 at 11:20:09AM CET, jprochaz@redhat.com wrote:
When user does not have PerfRepo installed and tries to use LNST PerfRepo commands, user is informed, PerfRepo commands are ignored and test is run without them.
When user does have PerfRepo installed, but does not have url/username/password informations in config file, LNST crashes on PerfRepoRESTAPIException because it tries to connect to URL "".
Desired behaviour would be - inform user, that he does not have needed credentials in config and ignore the commands in the same way they are ignored when the PerfRepo is not installed on the machine.
This patch fixes that. User gets warning logging messages for all of credentials that are missing and that PerfRepo commands will be ignored and test is run without PerfRepo commands.
Signed-off-by: Jiri Prochazka jprochaz@redhat.com
Applied. Thanks!
-Jan
lnst-developers@lists.fedorahosted.org