Fix token generation. 50/15750/4
authorAric Gardner <agardner@linuxfoundation.org>
Thu, 23 May 2019 16:36:25 +0000 (12:36 -0400)
committerAric Gardner <agardner@linuxfoundation.org>
Tue, 28 May 2019 14:53:47 +0000 (14:53 +0000)
commit9565c01c757b2930159c3b1792e6ca02a82fbae6
treecb6051ae98ef112cc35bbc277917790309055e23
parentad39a4d3375dee17282ad6673350d346fa063009
Fix token generation.

Remove legacy method of token generation.

username and password come from global section of lftools.ini.
[global]
username = lfid
password =

url comes from -s section of jenkins_jobs.ini
eg: [jenkins.acumos.org/sandbox]
url=jenkins.acumos.org/sandbox

example command
lftools jenkins -s 'jenkins.acumos.org/sandbox' token change

option --name set token name default is token-created-by-lftools

changeApiToken no longer exists, so we must allways generate a
new token.

NOTE: token print and token change now do the same thing.
That is generate a new token and return it to console.
I could remove one of them but Im wary of breaking any
legacy scripts that may exist.

NOTE: This will not work with SAML Plugin jenkins.
But I need it for automation before we switch all
jenkins to SAML

ISSUE: RELENG-2046
Signed-off-by: Aric Gardner <agardner@linuxfoundation.org>
Change-Id: I075c530f6e9fad7b477383867d52b83bba745662
lftools/cli/jenkins/token.py
lftools/jenkins/token.py